diff options
author | Rocky Madden <git@rockymadden.com> | 2013-01-23 13:46:48 -0700 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2013-01-23 13:46:48 -0700 |
commit | f8bb27fee794418e0672c9971981e98aada973d7 (patch) | |
tree | 68362bb67cc689ddc0a02818028a7a6692b91c19 /readme.md | |
parent | b15f5b5db714223af972f73cdbda05e5a539423d (diff) | |
download | stringmetric-f8bb27fee794418e0672c9971981e98aada973d7.tar.gz stringmetric-f8bb27fee794418e0672c9971981e98aada973d7.tar.bz2 stringmetric-f8bb27fee794418e0672c9971981e98aada973d7.zip |
Added Jaro examples.
Diffstat (limited to 'readme.md')
-rwxr-xr-x | readme.md | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -22,7 +22,7 @@ Useful for approximate string matching and measurement of string distance. Most __Dice / Sorensen Metric:__ ```scala println(DiceSorensenMetric.compare("night", "nacht")) -println(DiceSorensenMetric.compare("context", "contact") +println(DiceSorensenMetric.compare("context", "contact")) ``` Output: @@ -34,15 +34,27 @@ Output: __Hamming Metric:__ ```scala println(HammingMetric.compare("toned", "roses")) -println(HammingMetric.compare("1011101", "1001001") +println(HammingMetric.compare("1011101", "1001001")) ``` -Output: +Output (note the exception of integers, rather than doubles, being returned): ```shell 3 2 ``` +__Jaro Metric:__ +```scala +println(HammingMetric.compare("dwayne", "duane")) +println(HammingMetric.compare("jones", "johnson")) +``` + +Output: +```shell +0.8222222222222223 +0.7904761904761904 +``` + ## Testing ```shell $ gradle :stringmetric-core:test |