blob: e5571de0350472b392c3cd7b734f9a0e2ee7cdb6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package com.rockymadden.stringmetric
import scala.language.implicitConversions
trait StringAlgorithm extends Algorithm[Array[Char]] {
def compute(a: String): Option[String]
}
object StringAlgorithm {
val Metaphone = phonetic.MetaphoneAlgorithm
val Nysiis = phonetic.NysiisAlgorithm
val RefinedNysiis = phonetic.RefinedNysiisAlgorithm
val RefinedSoundex = phonetic.RefinedSoundexAlgorithm
val Soundex = phonetic.SoundexAlgorithm
implicit def toStringAlgorithmDecorator(sa: StringAlgorithm): StringAlgorithmDecorator =
new StringAlgorithmDecorator(sa)
def computeWithMetaphone(a: Array[Char]) = Metaphone.compute(a)
def computeWithNysiis(a: Array[Char]) = Nysiis.compute(a)
def computeWithRefinedNysiis(a: Array[Char]) = RefinedNysiis.compute(a)
def computeWithRefinedSoundex(a: Array[Char]) = RefinedSoundex.compute(a)
def computeWithSoundex(a: Array[Char]) = Soundex.compute(a)
}
|