update
parent
6f910d5118
commit
dd09371297
|
@ -122,3 +122,26 @@ fuzz.WRatio("mariners", "mariner are playing tomorrow mariner are playing tomorr
|
|||
fuzz.WRatio("mariners", "mariner are playing tomorrow mariner are playing tomorrow mariner are playing tomorrow mariner are playing tomorrow")
|
||||
fuzz.WRatio("mariners", "mariner are playing tomorrow mariner are playing tomorrow mariner are playing tomorrow mariner are playing tomorrow")
|
||||
=#
|
||||
|
||||
|
||||
using StringDistances, Test
|
||||
|
||||
# check with weird utf8 strings
|
||||
compare("aüa", "aua", TokenMax(RatcliffObershelp()))
|
||||
compare("aüa", "aua", TokenMax(QGram(2)))
|
||||
compare("aüa", "aua", DamerauLevenshtein())
|
||||
compare("aüa", "aua", Hamming())
|
||||
compare("aüa", "aua", Jaro())
|
||||
compare("aüa", "aua", Levenshtein())
|
||||
|
||||
|
||||
s1 = "aü☃"
|
||||
s2 = "aüaüafs"
|
||||
dist = QGram(4)
|
||||
@test evaluate(dist, s1, s2) == 4
|
||||
|
||||
# check Substrings work
|
||||
s1 = SubString(s1, 1, 4)
|
||||
s2 = SubString(s2, 1, 4)
|
||||
dist = QGram(2)
|
||||
@test evaluate(dist, s1, s2) == 2
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using StringDistances
|
||||
|
||||
tests = ["distances.jl", "modifiers.jl", "utf8.jl"]
|
||||
tests = ["distances.jl", "modifiers.jl"]
|
||||
|
||||
println("Running tests:")
|
||||
|
||||
|
|
21
test/utf8.jl
21
test/utf8.jl
|
@ -1,21 +0,0 @@
|
|||
using StringDistances, Test
|
||||
|
||||
# check with weird utf8 strings
|
||||
compare("aüa", "aua", TokenMax(RatcliffObershelp()))
|
||||
compare("aüa", "aua", TokenMax(QGram(2)))
|
||||
compare("aüa", "aua", DamerauLevenshtein())
|
||||
compare("aüa", "aua", Hamming())
|
||||
compare("aüa", "aua", Jaro())
|
||||
compare("aüa", "aua", Levenshtein())
|
||||
|
||||
|
||||
s1 = "aü☃"
|
||||
s2 = "aüaüafs"
|
||||
dist = QGram(4)
|
||||
@test evaluate(dist, s1, s2) == 4
|
||||
|
||||
# check Substrings work
|
||||
s1 = SubString(s1, 1, 4)
|
||||
s2 = SubString(s2, 1, 4)
|
||||
dist = QGram(2)
|
||||
@test evaluate(dist, s1, s2) == 2
|
Loading…
Reference in New Issue