Jaro-Winkler distance: Difference between revisions

(Added Java solution)
Line 1,368:
wick | 0.11664
</pre>
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<lang Mathematica>ClearAll[JWD]
JWD[a_][b_]:=Experimental`JaroWinklerDistance[a,b]
dict=DictionaryLookup[];
TakeSmallestBy[dict->{"Element","Value"},JWD["accomodate"],5]//Grid
TakeSmallestBy[dict->{"Element","Value"},JWD["definately"],5]//Grid
TakeSmallestBy[dict->{"Element","Value"},JWD["goverment"],5]//Grid
TakeSmallestBy[dict->{"Element","Value"},JWD["occured"],5]//Grid
TakeSmallestBy[dict->{"Element","Value"},JWD["publically"],5]//Grid
TakeSmallestBy[dict->{"Element","Value"},JWD["recieve"],5]//Grid
TakeSmallestBy[dict->{"Element","Value"},JWD["seperate"],5]//Grid
TakeSmallestBy[dict->{"Element","Value"},JWD["untill"],5]//Grid
TakeSmallestBy[dict->{"Element","Value"},JWD["wich"],5]//Grid</lang>
{{out}}
<pre>accommodate 0.0181818
accommodated 0.0333333
accommodates 0.0333333
accommodation 0.0815385
accommodating 0.0815385
 
definitely 0.04
defiantly 0.0422222
definably 0.0622222
definitively 0.07
define 0.08
 
government 0.0422222
governments 0.0585859
govern 0.0666667
governmental 0.0722222
governs 0.0952381
 
occurred 0.025
occur 0.0571429
occupied 0.0785714
occurs 0.0904762
cured 0.0952381
 
publicly 0.04
public 0.08
publican 0.085
publicans 0.104444
publicity 0.10444
 
receive 0.0333333
receives 0.0625
received 0.0625
receiver 0.0625
reeve 0.0761905
 
desperate 0.0787037
separate 0.0916667
separateness 0.106944
sprat 0.1125
separated 0.114352
 
until 0.0333333
untiled 0.0904762
untiles 0.0904762
unlit 0.0977778
untypically 0.106061
 
winch 0.0533333
witch 0.0533333
which 0.06
switch 0.111111
twitch 0.111111</pre>
 
=={{header|Nim}}==
1,111

edits