Skip to content

Commit 6b7820c

Browse files
committed
Bug on calling Levenshtein
1 parent f661f3a commit 6b7820c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/Darklabel91/metaphone-br
22

33
go 1.18
44

5-
require github.com/Darklabel91/API_Names v0.0.0-20230324234458-cb4ad2f792ce
5+
require github.com/Darklabel91/Levenshtein v0.0.0-20230327180915-520182aba65a // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github.com/Darklabel91/API_Names v0.0.0-20230324234458-cb4ad2f792ce h1:mN3URM8qmoGL1Lo6z0mDrHlr6yqwm23yi3ePvA2BlmM=
2-
github.com/Darklabel91/API_Names v0.0.0-20230324234458-cb4ad2f792ce/go.mod h1:YG8GhicKhztHWCS7iSgWMA4M7Mr/irP5jBTyBrV34W8=
1+
github.com/Darklabel91/Levenshtein v0.0.0-20230327180915-520182aba65a h1:/nTBmKXehgl606NX4oqbKXMC5fVWPyjNBiSfnX9S2jM=
2+
github.com/Darklabel91/Levenshtein v0.0.0-20230327180915-520182aba65a/go.mod h1:8sU0Aii5Eog/JhC/LtRaSR4jSvgQyDN84rG2ihtm1iU=

metaphonebr.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func IsMetaphoneSimilar(metaphone1, metaphone2 string) bool {
113113
margin = 1
114114
}
115115

116-
if levenshtein.Distance(metaphone1, metaphone2) <= margin {
116+
if Levenshtein.Distance(metaphone1, metaphone2) <= margin {
117117
return true
118118
}
119119
return false
@@ -129,7 +129,7 @@ func SimilarityBetweenWords(word1, word2 string) float32 {
129129
maxsize = float32(len(word1))
130130
}
131131

132-
return 1.0 - (float32(levenshtein.Distance(word1, word2)) / maxsize)
132+
return 1.0 - (float32(Levenshtein.Distance(word1, word2)) / maxsize)
133133
}
134134

135135
//init sequence of regexp

0 commit comments

Comments
 (0)