summaryrefslogtreecommitdiff
path: root/cli/source/main/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiisalgorithm.scala
blob: 3fc9f25795f44ba6feeb24a77a004106d0d690d9 (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.RefinedNysiisAlgorithm

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