diff options
Diffstat (limited to 'cli/src/main/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithm.scala')
-rwxr-xr-x | cli/src/main/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithm.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cli/src/main/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithm.scala b/cli/src/main/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithm.scala new file mode 100755 index 0000000..bef2bc5 --- /dev/null +++ b/cli/src/main/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithm.scala @@ -0,0 +1,16 @@ +package com.rockymadden.stringmetric.cli.phonetic + +import com.rockymadden.stringmetric.cli._ +import com.rockymadden.stringmetric.phonetic.NysiisAlgorithm + +case object nysiisalgorithm extends Command( + (opts) => + "Returns the phonetic representation of the passed string, per the NYSIIS algorithm." + Ls + Ls + + "Syntax:" + Ls + + Tab + "nysiisalgorithm [Options] string..." + Ls + Ls + + "Options:" + Ls + + Tab + "-h, --help" + Ls + + Tab + Tab + "Outputs description, syntax, and options.", + (opts) => opts.contains('dashless) && (opts('dashless): Array[String]).length == 1, + (opts) => NysiisAlgorithm.compute(opts('dashless)).getOrElse("not computable") +) |