summaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorRocky Madden <git@rockymadden.com>2013-03-12 17:58:02 -0600
committerRocky Madden <git@rockymadden.com>2013-03-12 17:58:02 -0600
commitd781f0b5787ac2b39f0a28c9df8c67902c971148 (patch)
tree96f3e2cd1f3bb9318b1c973afa7efcfe9b4b131e /readme.md
parentb848cf2945b0be8d9fad0e81d98deda78e7443dd (diff)
downloadstringmetric-d781f0b5787ac2b39f0a28c9df8c67902c971148.tar.gz
stringmetric-d781f0b5787ac2b39f0a28c9df8c67902c971148.tar.bz2
stringmetric-d781f0b5787ac2b39f0a28c9df8c67902c971148.zip
Added overlap metric examples.
Diffstat (limited to 'readme.md')
-rwxr-xr-xreadme.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/readme.md b/readme.md
index 7d3a4d5..fc085c4 100755
--- a/readme.md
+++ b/readme.md
@@ -181,6 +181,20 @@ Array("abc", "bcd", "cde", "def", "efg", "fgh", "ghi", "hij", "ijk", "jkl", "klm
---
+__Overlap Metric:__ _(Note you must specify the size of the n-gram you wish to use. This can be done implicitly.)_
+```scala
+println(OverlapMetric.compare("night", "nacht")(1))
+println(OverlapMetric.compare("context", "contact")(1))
+```
+
+Output:
+```
+0.6
+0.7142857142857143
+```
+
+---
+
__Ratcliff/Obershelp Metric:__
```scala
println(RatcliffObershelpMetric.compare("aleksander", "alexandre"))