Jaro-Winkler distance: Difference between revisions

Content added Content deleted
m (Rust - bug fix)
m (remove spaces, redo output)
Line 60: Line 60:
Using a dictionary of your choice and the following list of 9 commonly misspelled words:
Using a dictionary of your choice and the following list of 9 commonly misspelled words:


"accomodate​", "definately​", "goverment​", "occured", "publically", "recieve​", "seperate", "untill​", "wich​"
"accomodate", "definately", "goverment​", "occured", "publically", "recieve​", "seperate", "untill", "wich​"


* Calculate the Jaro-Winkler distance between the misspelled word and words in the dictionary.
* Calculate the Jaro-Winkler distance between the misspelled word and words in the dictionary.
Line 211: Line 211:
"accomodate​",
"accomodate​",
"definately​",
"definately​",
"goverment​",
"goverment",
"occured",
"occured",
"publically",
"publically",
"recieve​",
"recieve",
"seperate",
"seperate",
"untill​",
"untill",
"wich​",
"wich",
]
]


Line 270: Line 270:
</lang>{{out}}
</lang>{{out}}
<pre>
<pre>
Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " accomodate​ " are:
Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " accomodate " are:
Word | Distance
Word | Distance
accommodate | 0.0364
accommodate | 0.0182
accommodated | 0.0515
accommodated | 0.0333
accommodates | 0.0515
accommodates | 0.0333
accommodating | 0.0979
accommodating | 0.0815
accommodation | 0.0979
accommodation | 0.0815


Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " definately​ " are:
Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " definately " are:
Word | Distance
Word | Distance
definitely | 0.0564
definitely | 0.0400
defiantly | 0.0586
defiantly | 0.0422
define | 0.0909
define | 0.0800
definite | 0.0977
definite | 0.0850
defiant | 0.1013
definable | 0.0872


Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " goverment​ " are:
Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " goverment " are:
Word | Distance
Word | Distance
government | 0.0733
government | 0.0533
govern | 0.0800
govern | 0.0667
governments | 0.0897
governments | 0.0697
movement | 0.0992
movement | 0.0810
governmental | 0.1033
governmental | 0.0833


Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " occured " are:
Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " occured " are:
Line 310: Line 310:
biblically | 0.1400
biblically | 0.1400


Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " recieve​ " are:
Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " recieve " are:
Word | Distance
Word | Distance
receive | 0.0625
receive | 0.0333
received | 0.0917
received | 0.0625
receiver | 0.0917
receiver | 0.0625
receives | 0.0917
receives | 0.0625
relieve | 0.0917
relieve | 0.0667


Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " seperate " are:
Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " seperate " are:
Line 326: Line 326:
separates | 0.1144
separates | 0.1144


Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " untill​ " are:
Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " untill " are:
Word | Distance
Word | Distance
until | 0.0571
until | 0.0333
untie | 0.1257
untie | 0.1067
untimely | 0.1321
untimely | 0.1083
Antilles | 0.1264
untidy | 0.1333


Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " wich​ " are:
Close dictionary words ( distance < 0.15 using Jaro-Winkler distance) to " wich " are:
Word | Distance
Word | Distance
witch | 0.1067
witch | 0.0533
which | 0.1200
which | 0.0600
witches | 0.1143
rich | 0.1167
wick | 0.1167
</pre>
</pre>



=={{header|Raku}}==
=={{header|Raku}}==