diff --git a/dict.go b/dict.go index f133cc4..0149fc6 100644 --- a/dict.go +++ b/dict.go @@ -8,6 +8,7 @@ import ( "strings" ) +// DefaultMinTokenLen is default minimum tokenLen var DefaultMinTokenLen = 2 // DictRecord records dict meta info diff --git a/minimum_matching.go b/minimum_matching.go index 089dcf8..8cedac9 100644 --- a/minimum_matching.go +++ b/minimum_matching.go @@ -4,11 +4,13 @@ import ( "strings" ) +// MinMatch records dict and dictPath type MinMatch struct { dict *Dict dictPath string } +// NewMinMatch returns a newly initialized MinMatch object func NewMinMatch(dictPath string) *MinMatch { return &MinMatch{ dictPath: dictPath, diff --git a/tokenizer.go b/tokenizer.go index 35cbe4e..7e2d621 100644 --- a/tokenizer.go +++ b/tokenizer.go @@ -1,5 +1,6 @@ package gotokenizer +// Tokenizer defines interface of Tokenizer type Tokenizer interface { GetFrequency(text string) (map[string]int, error) Get(text string) ([]string, error)