summaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorRocky Madden <git@rockymadden.com>2012-11-17 10:52:26 -0700
committerRocky Madden <git@rockymadden.com>2012-11-17 10:52:26 -0700
commit4590780e80c8a56586b94ac972e5239f396459c8 (patch)
tree390d671713a3ae0b05d5d3420ed6143afaee2bcb /readme.md
parentbc40b9b4f51fc14f6855738a209c618e8370737a (diff)
downloadstringmetric-4590780e80c8a56586b94ac972e5239f396459c8.tar.gz
stringmetric-4590780e80c8a56586b94ac972e5239f396459c8.tar.bz2
stringmetric-4590780e80c8a56586b94ac972e5239f396459c8.zip
Changed ordering and simplified.
Diffstat (limited to 'readme.md')
-rwxr-xr-xreadme.md27
1 files changed, 11 insertions, 16 deletions
diff --git a/readme.md b/readme.md
index 2b65c5c..3207e32 100755
--- a/readme.md
+++ b/readme.md
@@ -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: