similarity

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add added in v0.0.3

func Add(uint64 []int, int int) []int

Add 加权

func Base64Encode added in v0.0.3

func Base64Encode(s string) string

Base64Encode encodes a byte slice to a base64 string.

func Dimensionality added in v0.0.3

func Dimensionality(ins []int) []int

降维度

func Int32StrToInts added in v0.0.3

func Int32StrToInts(ins string) []int

Int32StrToInts 将uint64转换成string

func IntsToStr added in v0.0.3

func IntsToStr(ins []int) string

IntsToStr []int 转换成string

func StrToStrs added in v0.0.3

func StrToStrs(s string, lenth int) []string

StrToStrs 字符串转化字符数组

func StrToStrs4 added in v0.0.3

func StrToStrs4(s string, lenth int) []string

StrToStrs4 每隔四个字符转换成一个字符串

func StringToBytes

func StringToBytes(s string) (b []byte)

Types

type Compare

type Compare func(s1, s2 string) float64

type Cosine added in v0.0.3

type Cosine struct {
}

Cosine similarity algorithm implementation.

func (Cosine) CompareAscii added in v0.0.3

func (c Cosine) CompareAscii(s1, s2 string) float64

func (Cosine) CompareUtf8 added in v0.0.3

func (c Cosine) CompareUtf8(utf8Str1, utf8Str2 string) float64

type DiceCoefficient

type DiceCoefficient struct {
	Ngram int
	// contains filtered or unexported fields
}

func (*DiceCoefficient) CompareAscii

func (d *DiceCoefficient) CompareAscii(s1, s2 string) float64

func (*DiceCoefficient) CompareUtf8

func (d *DiceCoefficient) CompareUtf8(s1, s2 string) float64

type EditDistance

type EditDistance struct {
	// contains filtered or unexported fields
}

func (*EditDistance) CompareAscii

func (e *EditDistance) CompareAscii(s1, s2 string) float64

ascii

func (*EditDistance) CompareUtf8

func (e *EditDistance) CompareUtf8(utf8Str1, utf8Str2 string) float64

utf8

type Hamming

type Hamming struct{}

func (*Hamming) CompareAscii

func (h *Hamming) CompareAscii(s1, s2 string) float64

func (*Hamming) CompareUtf8

func (h *Hamming) CompareUtf8(utf8Str1, utf8Str2 string) float64

type Jaro

type Jaro struct {
	MatchWindow int
	// contains filtered or unexported fields
}

func (*Jaro) CompareAscii

func (j *Jaro) CompareAscii(s1, s2 string) float64

func (*Jaro) CompareUtf8

func (j *Jaro) CompareUtf8(s1, s2 string) float64

type JaroWinkler added in v0.0.3

type JaroWinkler struct {
	MatchWindow int
	// contains filtered or unexported fields
}

func (*JaroWinkler) CompareAscii added in v0.0.3

func (j *JaroWinkler) CompareAscii(s1, s2 string) float64

func (*JaroWinkler) CompareUtf8 added in v0.0.3

func (j *JaroWinkler) CompareUtf8(s1, s2 string) float64

type Match

type Match struct {
	S     string
	Score float64
}

type MatchResult

type MatchResult struct {
	AllResult []*Match
	Match     *Match
	BestIndex int
}

type Simhash added in v0.0.3

type Simhash struct {
}

func (Simhash) CompareAscii added in v0.0.3

func (s Simhash) CompareAscii(s1, s2 string) float64

func (Simhash) CompareUtf8 added in v0.0.3

func (s Simhash) CompareUtf8(utf8Str1, utf8Str2 string) float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL