diff options
author | Rocky Madden <git@rockymadden.com> | 2013-12-28 17:19:13 -0700 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2013-12-28 17:19:13 -0700 |
commit | 75d6fbe5e3fcea28754e9c2fc4b0bcefcf512665 (patch) | |
tree | f9692b62402520a2c738476e13793ab6939e2c3c /core/source | |
parent | 6148bc303b91ad20c3ba5902da25b462f3ce6df5 (diff) | |
download | stringmetric-75d6fbe5e3fcea28754e9c2fc4b0bcefcf512665.tar.gz stringmetric-75d6fbe5e3fcea28754e9c2fc4b0bcefcf512665.tar.bz2 stringmetric-75d6fbe5e3fcea28754e9c2fc4b0bcefcf512665.zip |
Removed like from traits.
Diffstat (limited to 'core/source')
26 files changed, 62 insertions, 62 deletions
diff --git a/core/source/main/scala/com/rockymadden/stringmetric/Algorithm.scala b/core/source/main/scala/com/rockymadden/stringmetric/Algorithm.scala index bb823aa..5acb9f3 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/Algorithm.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/Algorithm.scala @@ -1,12 +1,12 @@ package com.rockymadden.stringmetric object Algorithm { - trait AlgorithmLike[A] { + trait Algorithm[A] { def compute(a: A): Option[A] } - trait StringAlgorithmLike extends AlgorithmLike[Array[Char]] { + trait StringAlgorithm extends Algorithm[Array[Char]] { def compute(a: String): Option[String] } } diff --git a/core/source/main/scala/com/rockymadden/stringmetric/Alphabet.scala b/core/source/main/scala/com/rockymadden/stringmetric/Alphabet.scala index 6d12dd4..5a7ee97 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/Alphabet.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/Alphabet.scala @@ -3,7 +3,7 @@ package com.rockymadden.stringmetric import scala.collection.immutable.Set object Alphabet { - sealed abstract class AlphabetLike(protected[Alphabet] val chars: Set[Char]) { + sealed abstract class Alphabet(val chars: Set[Char]) { def isSuperset(a: Char): Boolean = chars.contains(a) def isSuperset(a: Array[Char]): Boolean = a.length > 0 && a.takeWhile(chars.contains).length == a.length @@ -12,31 +12,31 @@ object Alphabet { } - case object LowercaseConsonant extends AlphabetLike( + case object LowercaseConsonant extends Alphabet( Set('b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x' ,'z') ) - case object UppercaseConsonant extends AlphabetLike( + case object UppercaseConsonant extends Alphabet( Set('B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X' ,'Z') ) - case object Consonant extends AlphabetLike(LowercaseConsonant.chars ++ UppercaseConsonant.chars) + case object Consonant extends Alphabet(LowercaseConsonant.chars ++ UppercaseConsonant.chars) - case object LowercaseVowel extends AlphabetLike(Set('a', 'e', 'i', 'o', 'u')) + case object LowercaseVowel extends Alphabet(Set('a', 'e', 'i', 'o', 'u')) - case object UppercaseVowel extends AlphabetLike(Set('A', 'E', 'I', 'O', 'U')) + case object UppercaseVowel extends Alphabet(Set('A', 'E', 'I', 'O', 'U')) - case object Vowel extends AlphabetLike(LowercaseVowel.chars ++ UppercaseVowel.chars) + case object Vowel extends Alphabet(LowercaseVowel.chars ++ UppercaseVowel.chars) - case object LowercaseY extends AlphabetLike(Set('y')) + case object LowercaseY extends Alphabet(Set('y')) - case object UppercaseY extends AlphabetLike(Set('Y')) + case object UppercaseY extends Alphabet(Set('Y')) - case object Y extends AlphabetLike(LowercaseY.chars ++ UppercaseY.chars) + case object Y extends Alphabet(LowercaseY.chars ++ UppercaseY.chars) - case object LowercaseAlpha extends AlphabetLike(LowercaseConsonant.chars ++ LowercaseVowel.chars ++ LowercaseY.chars) + case object LowercaseAlpha extends Alphabet(LowercaseConsonant.chars ++ LowercaseVowel.chars ++ LowercaseY.chars) - case object UppercaseAlpha extends AlphabetLike(UppercaseConsonant.chars ++ UppercaseVowel.chars ++ UppercaseY.chars) + case object UppercaseAlpha extends Alphabet(UppercaseConsonant.chars ++ UppercaseVowel.chars ++ UppercaseY.chars) - case object Alpha extends AlphabetLike(LowercaseAlpha.chars ++ UppercaseAlpha.chars) + case object Alpha extends Alphabet(LowercaseAlpha.chars ++ UppercaseAlpha.chars) } diff --git a/core/source/main/scala/com/rockymadden/stringmetric/Metric.scala b/core/source/main/scala/com/rockymadden/stringmetric/Metric.scala index 64be8fa..5423d4d 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/Metric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/Metric.scala @@ -1,12 +1,12 @@ package com.rockymadden.stringmetric object Metric { - trait MetricLike[A, B] { + trait Metric[A, B] { def compare(a: A, b: A): Option[B] } - trait StringMetricLike[A] extends MetricLike[Array[Char], A] { + trait StringMetric[A] extends Metric[Array[Char], A] { def compare(a: String, b: String): Option[A] } } diff --git a/core/source/main/scala/com/rockymadden/stringmetric/Tokenizer.scala b/core/source/main/scala/com/rockymadden/stringmetric/Tokenizer.scala index aae9742..7053f98 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/Tokenizer.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/Tokenizer.scala @@ -1,12 +1,12 @@ package com.rockymadden.stringmetric object Tokenizer { - trait TokenizerLike[A] { + trait Tokenizer[A] { def tokenize(a: A): Option[Array[A]] } - trait StringTokenizerLike extends TokenizerLike[Array[Char]] { + trait StringTokenizer extends Tokenizer[Array[Char]] { def tokenize(a: String): Option[Array[String]] } } diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/MetaphoneAlgorithm.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/MetaphoneAlgorithm.scala index 64c16db..3d98d55 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/MetaphoneAlgorithm.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/MetaphoneAlgorithm.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Algorithm.StringAlgorithmLike +import com.rockymadden.stringmetric.Algorithm.StringAlgorithm -case object MetaphoneAlgorithm extends StringAlgorithmLike { +case object MetaphoneAlgorithm extends StringAlgorithm { import com.rockymadden.stringmetric.Alphabet.{Alpha, LowercaseVowel} override def compute(a: Array[Char]): Option[Array[Char]] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetric.scala index 7d9cd1d..d06f774 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -case object MetaphoneMetric extends StringMetricLike[Boolean] { +case object MetaphoneMetric extends StringMetric[Boolean] { import com.rockymadden.stringmetric.Alphabet.Alpha override def compare(a: Array[Char], b: Array[Char]): Option[Boolean] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/NysiisAlgorithm.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/NysiisAlgorithm.scala index c9245e0..3e46675 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/NysiisAlgorithm.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/NysiisAlgorithm.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Algorithm.StringAlgorithmLike +import com.rockymadden.stringmetric.Algorithm.StringAlgorithm -case object NysiisAlgorithm extends StringAlgorithmLike { +case object NysiisAlgorithm extends StringAlgorithm { import com.rockymadden.stringmetric.Alphabet.{Alpha, LowercaseVowel} override def compute(a: Array[Char]): Option[Array[Char]] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/NysiisMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/NysiisMetric.scala index 84c2073..c9a0914 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/NysiisMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/NysiisMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -case object NysiisMetric extends StringMetricLike[Boolean] { +case object NysiisMetric extends StringMetric[Boolean] { import com.rockymadden.stringmetric.Alphabet.Alpha override def compare(a: Array[Char], b: Array[Char]): Option[Boolean] = { diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedNysiisAlgorithm.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedNysiisAlgorithm.scala index c35175d..9976847 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedNysiisAlgorithm.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedNysiisAlgorithm.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Algorithm.StringAlgorithmLike +import com.rockymadden.stringmetric.Algorithm.StringAlgorithm -case object RefinedNysiisAlgorithm extends StringAlgorithmLike { +case object RefinedNysiisAlgorithm extends StringAlgorithm { import com.rockymadden.stringmetric.Alphabet.{Alpha, LowercaseVowel} override def compute(a: Array[Char]): Option[Array[Char]] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedNysiisMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedNysiisMetric.scala index 86111e4..488f261 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedNysiisMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedNysiisMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -case object RefinedNysiisMetric extends StringMetricLike[Boolean] { +case object RefinedNysiisMetric extends StringMetric[Boolean] { import com.rockymadden.stringmetric.Alphabet.Alpha override def compare(a: Array[Char], b: Array[Char]): Option[Boolean] = { diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedSoundexAlgorithm.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedSoundexAlgorithm.scala index 7fb6dfc..e8f3af6 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedSoundexAlgorithm.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedSoundexAlgorithm.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Algorithm.StringAlgorithmLike +import com.rockymadden.stringmetric.Algorithm.StringAlgorithm -case object RefinedSoundexAlgorithm extends StringAlgorithmLike { +case object RefinedSoundexAlgorithm extends StringAlgorithm { import com.rockymadden.stringmetric.Alphabet.Alpha override def compute(a: Array[Char]): Option[Array[Char]] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedSoundexMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedSoundexMetric.scala index a7d3984..289fe29 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedSoundexMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/RefinedSoundexMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -case object RefinedSoundexMetric extends StringMetricLike[Boolean] { +case object RefinedSoundexMetric extends StringMetric[Boolean] { import com.rockymadden.stringmetric.Alphabet.Alpha override def compare(a: Array[Char], b: Array[Char]): Option[Boolean] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/SoundexAlgorithm.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/SoundexAlgorithm.scala index 98898e9..b211908 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/SoundexAlgorithm.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/SoundexAlgorithm.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Algorithm.StringAlgorithmLike +import com.rockymadden.stringmetric.Algorithm.StringAlgorithm -case object SoundexAlgorithm extends StringAlgorithmLike { +case object SoundexAlgorithm extends StringAlgorithm { import com.rockymadden.stringmetric.Alphabet.Alpha override def compute(a: Array[Char]): Option[Array[Char]] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/SoundexMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/SoundexMetric.scala index 29e2606..eca32db 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/phonetic/SoundexMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/phonetic/SoundexMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.phonetic -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -case object SoundexMetric extends StringMetricLike[Boolean] { +case object SoundexMetric extends StringMetric[Boolean] { import com.rockymadden.stringmetric.Alphabet.Alpha override def compare(a: Array[Char], b: Array[Char]): Option[Boolean] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/DiceSorensenMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/DiceSorensenMetric.scala index 2c16bba..79d259d 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/DiceSorensenMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/DiceSorensenMetric.scala @@ -1,12 +1,12 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric /** * An implementation of the Dice/Sorensen metric. This implementation differs in that n-gram size is required. * Traditionally, the algorithm uses bigrams. */ -final case class DiceSorensenMetric(private val n: Int) extends StringMetricLike[Double] { +final case class DiceSorensenMetric(private val n: Int) extends StringMetric[Double] { import com.rockymadden.stringmetric.tokenize.NGramTokenizer import com.rockymadden.stringmetric.MatchTuple diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/HammingMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/HammingMetric.scala index f1527d2..4a90f32 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/HammingMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/HammingMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -case object HammingMetric extends StringMetricLike[Int] { +case object HammingMetric extends StringMetric[Int] { import com.rockymadden.stringmetric.CompareTuple override def compare(a: Array[Char], b: Array[Char]): Option[Int] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaccardMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaccardMetric.scala index 154ee48..c57ff56 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaccardMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaccardMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -final case class JaccardMetric(private val n: Int) extends StringMetricLike[Double] { +final case class JaccardMetric(private val n: Int) extends StringMetric[Double] { import com.rockymadden.stringmetric.tokenize.NGramTokenizer override def compare(a: Array[Char], b: Array[Char]): Option[Double] = { diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaroMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaroMetric.scala index c58b864..575d67a 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaroMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaroMetric.scala @@ -1,13 +1,13 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric import scala.Some /** * An implementation of the Jaro metric. One differing detail in this implementation is that if a character is matched * in string2, it cannot be matched upon again. This results in a more penalized distance in these scenarios. */ -case object JaroMetric extends StringMetricLike[Double] { +case object JaroMetric extends StringMetric[Double] { import com.rockymadden.stringmetric.{CompareTuple, MatchTuple} import scala.collection.mutable.{ArrayBuffer, HashSet} diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaroWinklerMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaroWinklerMetric.scala index 8d5d724..e83f73f 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaroWinklerMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/JaroWinklerMetric.scala @@ -1,13 +1,13 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric /** * An implementation of the Jaro-Winkler metric. One differing detail in this implementation is that if a character is * matched in string2, it cannot be matched upon again. This results in a more penalized distance in these scenarios * (e.g. comparing henka and henkan distance is 0.9666 versus the typical 0.9722). */ -case object JaroWinklerMetric extends StringMetricLike[Double] { +case object JaroWinklerMetric extends StringMetric[Double] { override def compare(a: Array[Char], b: Array[Char]): Option[Double] = JaroMetric.compare(a, b).map { case 0d => 0d diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/LevenshteinMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/LevenshteinMetric.scala index e145e1f..fb90cdc 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/LevenshteinMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/LevenshteinMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -case object LevenshteinMetric extends StringMetricLike[Int] { +case object LevenshteinMetric extends StringMetric[Int] { import com.rockymadden.stringmetric.CompareTuple override def compare(a: Array[Char], b: Array[Char]): Option[Int] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/NGramMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/NGramMetric.scala index 2b2fc01..240c933 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/NGramMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/NGramMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -final case class NGramMetric(private val n: Int) extends StringMetricLike[Double] { +final case class NGramMetric(private val n: Int) extends StringMetric[Double] { import com.rockymadden.stringmetric.MatchTuple import com.rockymadden.stringmetric.tokenize.NGramTokenizer import scala.math diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/OverlapMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/OverlapMetric.scala index b6b3bb9..718833f 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/OverlapMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/OverlapMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -final case class OverlapMetric(private val n: Int) extends StringMetricLike[Double] { +final case class OverlapMetric(private val n: Int) extends StringMetric[Double] { import com.rockymadden.stringmetric.MatchTuple import com.rockymadden.stringmetric.tokenize.NGramTokenizer import scala.math diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/RatcliffObershelpMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/RatcliffObershelpMetric.scala index 1562f79..fa113bc 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/RatcliffObershelpMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/RatcliffObershelpMetric.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric -case object RatcliffObershelpMetric extends StringMetricLike[Double] { +case object RatcliffObershelpMetric extends StringMetric[Double] { import com.rockymadden.stringmetric.CompareTuple override def compare(a: Array[Char], b: Array[Char]): Option[Double] = diff --git a/core/source/main/scala/com/rockymadden/stringmetric/similarity/WeightedLevenshteinMetric.scala b/core/source/main/scala/com/rockymadden/stringmetric/similarity/WeightedLevenshteinMetric.scala index 74fb320..ae6f49c 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/similarity/WeightedLevenshteinMetric.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/similarity/WeightedLevenshteinMetric.scala @@ -1,9 +1,9 @@ package com.rockymadden.stringmetric.similarity -import com.rockymadden.stringmetric.Metric.StringMetricLike +import com.rockymadden.stringmetric.Metric.StringMetric final case class WeightedLevenshteinMetric(delete: BigDecimal, insert: BigDecimal, substitute: BigDecimal) - extends StringMetricLike[Double] { + extends StringMetric[Double] { import com.rockymadden.stringmetric.CompareTuple diff --git a/core/source/main/scala/com/rockymadden/stringmetric/tokenize/NGramTokenizer.scala b/core/source/main/scala/com/rockymadden/stringmetric/tokenize/NGramTokenizer.scala index e2a2731..8784ca5 100755 --- a/core/source/main/scala/com/rockymadden/stringmetric/tokenize/NGramTokenizer.scala +++ b/core/source/main/scala/com/rockymadden/stringmetric/tokenize/NGramTokenizer.scala @@ -1,8 +1,8 @@ package com.rockymadden.stringmetric.tokenize -import com.rockymadden.stringmetric.Tokenizer.StringTokenizerLike +import com.rockymadden.stringmetric.Tokenizer.StringTokenizer -final case class NGramTokenizer(private val n: Int) extends StringTokenizerLike { +final case class NGramTokenizer(private val n: Int) extends StringTokenizer { override def tokenize(a: Array[Char]): Option[Array[Array[Char]]] = { if (n <= 0) return None diff --git a/core/source/test/scala/com/rockymadden/stringmetric/TransformSpec.scala b/core/source/test/scala/com/rockymadden/stringmetric/TransformSpec.scala index a5da25d..b038f1b 100644 --- a/core/source/test/scala/com/rockymadden/stringmetric/TransformSpec.scala +++ b/core/source/test/scala/com/rockymadden/stringmetric/TransformSpec.scala @@ -4,7 +4,7 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class TransformSpec extends ScalaTest { "Transform" should provide { +final class TransformSpec extends ScalaTest { "StringTransform" should provide { import com.rockymadden.stringmetric.Transform._ "filterAlpha()" when passed { |