blob: 12ac8e0993f4641b674c89126d474ff63fdf1d8d (
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.RefinedSoundexAlgorithm
case object refinedsoundexalgorithm extends Command(
(opts) =>
"Returns the phonetic representation of the passed string, per the refined Soundex algorithm." + Ls + Ls +
"Syntax:" + Ls +
Tab + "refinedsoundexalgorithm [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) => RefinedSoundexAlgorithm.compute(opts('dashless)).getOrElse("not computable")
)
|