Documentation ¶
Index ¶
- func Compare(s1, s2 string, opts ...Option) float64
- func FindBestMatch(s string, targets []string, opts ...Option) *similarity.MatchResult
- func FindBestMatchOne(s string, targets []string, opts ...Option) *similarity.Match
- type Option
- type OptionFunc
- func Cosine() OptionFunc
- func Default() OptionFunc
- func DiceCoefficient(ngram ...int) OptionFunc
- func Hamming() OptionFunc
- func IgnoreCase() OptionFunc
- func IgnoreSpace() OptionFunc
- func Jaro(matchWindow ...int) OptionFunc
- func JaroWinkler(matchWindow ...int) OptionFunc
- func Simhash() OptionFunc
- func UseASCII() OptionFunc
- func UseBase64() OptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindBestMatch ¶ added in v0.0.2
func FindBestMatch(s string, targets []string, opts ...Option) *similarity.MatchResult
返回相似度最高的那个字符串, 以及索引位置
func FindBestMatchOne ¶
func FindBestMatchOne(s string, targets []string, opts ...Option) *similarity.Match
返回相似度最高的那个字符串
Types ¶
type OptionFunc ¶
type OptionFunc func(*option)
func Cosine ¶ added in v0.0.3
func Cosine() OptionFunc
func Default ¶
func Default() OptionFunc
func Hamming ¶
func Hamming() OptionFunc
func JaroWinkler ¶ added in v0.0.3
func JaroWinkler(matchWindow ...int) OptionFunc
JaroWinkler ngram 是筛子系数需要用的一个值
func Simhash ¶ added in v0.0.3
func Simhash() OptionFunc
func (OptionFunc) Apply ¶
func (o OptionFunc) Apply(opt *option)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.