diff options
author | Rocky Madden <git@rockymadden.com> | 2012-11-17 10:52:26 -0700 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2012-11-17 10:52:26 -0700 |
commit | 4590780e80c8a56586b94ac972e5239f396459c8 (patch) | |
tree | 390d671713a3ae0b05d5d3420ed6143afaee2bcb | |
parent | bc40b9b4f51fc14f6855738a209c618e8370737a (diff) | |
download | stringmetric-4590780e80c8a56586b94ac972e5239f396459c8.tar.gz stringmetric-4590780e80c8a56586b94ac972e5239f396459c8.tar.bz2 stringmetric-4590780e80c8a56586b94ac972e5239f396459c8.zip |
Changed ordering and simplified.
-rwxr-xr-x | readme.md | 27 |
1 files changed, 11 insertions, 16 deletions
@@ -30,22 +30,6 @@ gradle :stringmetric-cli:tar ``` ## Using the API -The easiest non-filtered example involves using the StringMetric convenience object. -```scala -import org.hashtree.stringmetric.StringMetric - -if (StringMetric.compareWithJaroWinkler("string1", "string2") >= 0.9) - println("It's likely you're a match!") -``` - -The easiest single filtered example involves using the StringMetric and StringFilter convenience objects. -```scala -import org.hashtree.stringmetric.{ StringFilter, StringMetric } - -if (StringMetric.compareWithJaroWinkler("string1", "string2")(StringFilter.asciiLetterCase) >= 0.9) - println("It's likely you're a match!") -``` - Basic example with no filtering. ```scala import org.hashtree.stringmetric.similarity.JaroWinklerMetric @@ -77,6 +61,17 @@ val distance = JaroWinklerMetric.compare("string1", "string2") if (distance >= 0.9) println("It's likely you're a match!") ``` +You can also use the StringMetric, StringAlgorithm, and StringFilter convenience objects. +```scala +import org.hashtree.stringmetric.{ StringAlgorithm, StringFilter, StringMetric} + +if (StringMetric.compareWithJaroWinkler("string1", "string2") >= 0.9) + println("It's likely you're a match!") + +if (StringMetric.compareWithJaroWinkler("string1", "string2")(StringFilter.asciiLetterCase) >= 0.9) + println("It's likely you're a match!") +``` + ## Using the CLI Uncompress the built tar and ensure you have ability to execute the commands. Execute the metric of choice via the command line: |