Implement tokenize().

This commit is contained in:
Gea-Suan Lin
2024-02-09 11:46:19 +08:00
parent b133273065
commit ce79d2b245
3 changed files with 21 additions and 3 deletions

View File

@@ -21,6 +21,10 @@ func Bigram(s string) []string {
return r
}
func Unigram(s string) []string {
return split(s)
}
func split(s string) []string {
bag := make([]string, 0)
for _, w := range re1.FindAllStringSubmatch(s, -1) {