diff options
author | Rocky Madden <git@rockymadden.com> | 2013-03-09 15:01:48 -0700 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2013-03-09 15:01:48 -0700 |
commit | 532568e38856f277eb947c46239ed39b98216947 (patch) | |
tree | dbed1f847de666babb0a40f94b7c00ccab5d93b2 /readme.md | |
parent | 2a775ee2a8279b458b84ef35c458c58b19aa98c9 (diff) | |
download | stringmetric-532568e38856f277eb947c46239ed39b98216947.tar.gz stringmetric-532568e38856f277eb947c46239ed39b98216947.tar.bz2 stringmetric-532568e38856f277eb947c46239ed39b98216947.zip |
Created Jaccard metric, spec, benchmark, and CLI.
Diffstat (limited to 'readme.md')
-rwxr-xr-x | readme.md | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -5,7 +5,7 @@ String metrics and phonetic algorithms for Scala. The library provides facilitie * __[Dice / Sorensen](http://en.wikipedia.org/wiki/Dice%27s_coefficient)__ (Similarity metric) * __[Double Metaphone](http://en.wikipedia.org/wiki/Metaphone)__ (On roadmap) * __[Hamming](http://en.wikipedia.org/wiki/Hamming_distance)__ (Similarity metric) -* __[Jaccard / Tanimoto](http://en.wikipedia.org/wiki/Jaccard_index)__ (On roadmap) +* __[Jaccard](http://en.wikipedia.org/wiki/Jaccard_index)__ (Similarity metric) * __[Jaro](http://en.wikipedia.org/wiki/Jaro-Winkler_distance)__ (Similarity metric) * __[Jaro-Winkler](http://en.wikipedia.org/wiki/Jaro-Winkler_distance)__ (Similarity metric) * __[Levenshtein](http://en.wikipedia.org/wiki/Levenshtein_distance)__ (Similarity metric) @@ -84,6 +84,20 @@ Output: _(Note the exception of integers, rather than doubles, being returned.)_ --- +__Jaccard Metric:__ +```scala +println(JaccardMetric.compare("night", "nacht")) +println(JaccardMetric.compare("context", "contact")) +``` + +Output: +``` +0.3 +0.35714285714285715 +``` + +--- + __Jaro Metric:__ ```scala println(JaroMetric.compare("dwayne", "duane")) |