similarity

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

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

Add 加权

func Base64Encode

func Base64Encode(s string) string

Base64Encode encodes a byte slice to a base64 string.

func Dimensionality

func Dimensionality(ins []int) []int

Dimensionality 降维度

func Int32StrToInts

func Int32StrToInts(ins string) []int

Int32StrToInts 将uint64转换成string

func IntsToStr

func IntsToStr(ins []int) string

IntsToStr []int 转换成string

func StrToStrs

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

StrToStrs 字符串转化字符数组

func StrToStrs4

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

type Cosine struct {
}

Cosine similarity algorithm implementation.

func (Cosine) CompareAscii

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

func (Cosine) CompareUtf8

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

CompareAscii ascii

func (*EditDistance) CompareUtf8

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

CompareUtf8 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

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

func (*JaroWinkler) CompareAscii

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

func (*JaroWinkler) CompareUtf8

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

type Simhash struct {
}

func (Simhash) CompareAscii

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

func (Simhash) CompareUtf8

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