summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xreadme.md23
1 files changed, 11 insertions, 12 deletions
diff --git a/readme.md b/readme.md
index 7710ddf..774dc36 100755
--- a/readme.md
+++ b/readme.md
@@ -252,7 +252,7 @@ It is possible to decorate algorithms and metrics with additional functionality,
---
-Non-decorated usage:
+Non-decorated:
```scala
MetaphoneAlgorithm.compute("abc123")
MetaphoneMetric.compare("abc123", "abc456")
@@ -260,14 +260,7 @@ MetaphoneMetric.compare("abc123", "abc456")
---
-Memoized:
-```scala
-(MetaphoneAlgorithm withMemoization).compute("abc123")
-```
-
----
-
-Single filter, so that we only examine alphabetical characters:
+Using a transform so that we only examine alphabetical characters:
```scala
(MetaphoneAlgorithm withTransform StringTransform.filterAlpha).compute("abc123")
(MetaphoneMetric withTransform StringTransform.filterAlpha).compare("abc123", "abc456")
@@ -275,7 +268,7 @@ Single filter, so that we only examine alphabetical characters:
---
-Functionally composed filter, so that we only examine alphabetical characters but the case won't matter:
+Using a functionally composed transform so that we only examine alphabetical characters, but the case will not matter:
```scala
val composedTransform = (StringTransform.filterAlpha andThen StringTransform.ignoreAlphaCase)
@@ -285,9 +278,8 @@ val composedTransform = (StringTransform.filterAlpha andThen StringTransform.ign
---
-Make your own:
+Making your own transform:
```scala
-// StringTransform is a type alias for (Array[Char] => Array[Char])
val myTransform: StringTransform = (ca) => ca.filter(_ == 'x')
(MetaphoneAlgorithm withTransform myTransform).compute("abc123")
@@ -296,6 +288,13 @@ val myTransform: StringTransform = (ca) => ca.filter(_ == 'x')
---
+Using memoization:
+```scala
+(MetaphoneAlgorithm withMemoization).compute("abc123")
+```
+
+---
+
## Convenience objects
Convenience objects are available to make interactions with the library easier.