blob: 95f14b68dba11b608cbe05e7687f44dcfc78a28f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
package com.rockymadden.stringmetric.cli.phonetic
import com.rockymadden.stringmetric.cli._
import com.rockymadden.stringmetric.phonetic.MetaphoneAlgorithm
case object metaphonealgorithm extends Command(
(opts) =>
"Returns the phonetic representation of the passed string, per the Metaphone algorithm." + Ls + Ls +
"Syntax:" + Ls +
Tab + "metaphonealgorithm [Options] string..." + Ls + Ls +
"Options:" + Ls +
Tab + "-h, --help" + Ls +
Tab + Tab + "Outputs description, syntax, and opts.",
(opts) => opts.contains('dashless) && (opts('dashless): Array[String]).length == 1,
(opts) => MetaphoneAlgorithm.compute(opts('dashless)).getOrElse("not computable")
)
|