summaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorRocky Madden <git@rockymadden.com>2013-01-23 13:46:48 -0700
committerRocky Madden <git@rockymadden.com>2013-01-23 13:46:48 -0700
commitf8bb27fee794418e0672c9971981e98aada973d7 (patch)
tree68362bb67cc689ddc0a02818028a7a6692b91c19 /readme.md
parentb15f5b5db714223af972f73cdbda05e5a539423d (diff)
downloadstringmetric-f8bb27fee794418e0672c9971981e98aada973d7.tar.gz
stringmetric-f8bb27fee794418e0672c9971981e98aada973d7.tar.bz2
stringmetric-f8bb27fee794418e0672c9971981e98aada973d7.zip
Added Jaro examples.
Diffstat (limited to 'readme.md')
-rwxr-xr-xreadme.md18
1 files changed, 15 insertions, 3 deletions
diff --git a/readme.md b/readme.md
index ae465a0..1091d65 100755
--- a/readme.md
+++ b/readme.md
@@ -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