diff options
Diffstat (limited to 'cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala')
-rwxr-xr-x | cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala index 00a078e..60d6a0b 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala @@ -9,19 +9,17 @@ import com.rockymadden.stringmetric.phonetic.RefinedNysiisMetric */ object refinedNysiisMetric extends Command { override def main(args: Array[String]): Unit = { - val options = OptionMap(args) + val options: OptionMap = args try if (options.contains('h) || options.contains('help)) { help() exit(options) - } else if (options.contains('dashless) && (options('dashless): OptionMapArray).length == 2) { + } else if (options.contains('dashless) && (options('dashless): Array[String]).length == 2) { execute(options) exit(options) } else throw new IllegalArgumentException("Expected valid syntax. See --help.") - catch { - case e: Throwable => error(e, options) - } + catch { case e: Throwable => error(e, options) } } override def help(): Unit = { @@ -39,7 +37,7 @@ object refinedNysiisMetric extends Command { } override def execute(options: OptionMap): Unit = { - val strings: OptionMapArray = options('dashless) + val strings: Array[String] = options('dashless) println(RefinedNysiisMetric.compare(strings(0), strings(1)).getOrElse("not comparable")) } |