pull/17/head
matthieugomez 2019-08-18 13:13:04 -04:00
parent 6f910d5118
commit dd09371297
3 changed files with 24 additions and 22 deletions

View File

@ -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

View File

@ -1,6 +1,6 @@
using StringDistances
tests = ["distances.jl", "modifiers.jl", "utf8.jl"]
tests = ["distances.jl", "modifiers.jl"]
println("Running tests:")

View File

@ -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