package com.rockymadden.stringmetric.cli.phonetic import com.rockymadden.stringmetric.cli._ import com.rockymadden.stringmetric.phonetic.RefinedSoundexMetric case object refinedsoundexmetric extends Command( (opts) => "Compares two strings to determine if they are phonetically similarly, per the refined Soundex algorithm." + Ls + Ls + "Syntax:" + Ls + Tab + "refinedsoundexmetric [Options] string1 string2..." + Ls + Ls + "Options:" + Ls + Tab + "-h, --help" + Ls + Tab + Tab + "Outputs description, syntax, and options.", (opts) => opts.contains('dashless) && (opts('dashless): Array[String]).length == 2, (opts) => { val strings: Array[String] = opts('dashless) RefinedSoundexMetric.compare(strings(0), strings(1)) .map(_.toString) .getOrElse("not comparable") } )