object StringDistance
Main class to organize functionality of different string distance algorithms
import com.github.vickumar1981.stringdistance.StringDistance._ import com.github.vickumar1981.stringdistance.impl.{ConstantGap, LinearGap} // Scores between strings val cosSimilarity: Double = Cosine.score("hello", "chello") val damerau: Double = Damerau.score("martha", "marhta") val diceCoefficient: Double = DiceCoefficient.score("martha", "marhta") val hamming: Double = Hamming.score("martha", "marhta") val jaccard: Double = Jaccard.score("karolin", "kathrin", 1) val jaro: Double = Jaro.score("martha", "marhta") val jaroWinkler: Double = JaroWinkler.score("martha", "marhta", 0.1) val levenshtein: Double = Levenshtein.score("martha", "marhta") val needlemanWunsch: Double = NeedlemanWunsch.score("martha", "marhta", ConstantGap()) val ngramSimilarity: Double = NGram.score("karolin", "kathrin", 1) val bigramSimilarity: Double = NGram.score("karolin", "kathrin", 2) val overlap: Double = Overlap.score("karolin", "kathrin", 1) val smithWaterman: Double = SmithWaterman.score("martha", "marhta", (LinearGap(gapValue = -1), Integer.MAX_VALUE)) val smithWatermanGotoh: Double = SmithWatermanGotoh.score("martha", "marhta", ConstantGap()) val tversky: Double = Tversky.score("karolin", "kathrin", 0.5) // Distances between strings val damerauDist: Int = Damerau.distance("martha", "marhta") val hammingDist: Int = Hamming.distance("martha", "marhta") val levenshteinDist: Int = Levenshtein.distance("martha", "marhta") val longestCommonSubSeq: Int = LongestCommonSeq.distance("martha", "marhta") val ngramDist: Int = NGram.distance("karolin", "kathrin", 1) val bigramDist: Int = NGram.distance("karolin", "kathrin", 2) // return a List[String] of ngram tokens val tokens = NGram.tokens("martha", 2) // List("ma", "ar", "rt", "th", "ha")
- Alphabetic
- By Inheritance
- StringDistance
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object Cosine extends StringMetric[CosineAlgorithm]
- object Damerau extends StringMetric[DamerauLevenshteinAlgorithm]
- object DiceCoefficient extends StringMetric[DiceCoefficientAlgorithm]
- object Hamming extends StringMetric[HammingAlgorithm]
- object Jaccard extends WeightedStringMetric[JaccardAlgorithm, Int]
- object Jaro extends StringMetric[JaroAlgorithm]
- object JaroWinkler extends WeightedStringMetric[JaroWinklerAlgorithm, Double]
- object Levenshtein extends StringMetric[LevenshteinAlgorithm]
- object LongestCommonSeq extends StringMetric[LongestCommonSeqAlorithm]
- object NGram extends WeightedStringMetric[NGramAlgorithm, Int] with NGramTokenizer
- object NeedlemanWunsch extends WeightedStringMetric[NeedlemanWunschAlgorithm, ConstantGap]
- object Overlap extends WeightedStringMetric[OverlapAlgorithm, Int]
- object SmithWaterman extends WeightedStringMetric[SmithWatermanAlgorithm, (Gap, Int)]
- object SmithWatermanGotoh extends WeightedStringMetric[SmithWatermanGotohAlgorithm, ConstantGap]
- object Tversky extends WeightedStringMetric[TverskyAlgorithm, Double]