blob: 0d194dae9e3ab71fee3c74c380d8b151990e38ff (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
package com.rockymadden.stringmetric
trait StringAlgorithm[A, B] extends Algorithm[String, A, B] {
def compute(charArray: Array[Char])(implicit a: A): Option[Array[Char]]
}
object StringAlgorithm {
type Metaphone = com.rockymadden.stringmetric.phonetic.MetaphoneAlgorithm
val Metaphone = com.rockymadden.stringmetric.phonetic.MetaphoneAlgorithm
type Nysiis = com.rockymadden.stringmetric.phonetic.NysiisAlgorithm
val Nysiis = com.rockymadden.stringmetric.phonetic.NysiisAlgorithm
type RefinedNysiis = com.rockymadden.stringmetric.phonetic.RefinedNysiisAlgorithm
val RefinedNysiis = com.rockymadden.stringmetric.phonetic.RefinedNysiisAlgorithm
type RefinedSoundex = com.rockymadden.stringmetric.phonetic.RefinedSoundexAlgorithm
val RefinedSoundex = com.rockymadden.stringmetric.phonetic.RefinedSoundexAlgorithm
type Soundex = com.rockymadden.stringmetric.phonetic.SoundexAlgorithm
val Soundex = com.rockymadden.stringmetric.phonetic.SoundexAlgorithm
def computeWithMetaphone(charArray: Array[Char]) = Metaphone.compute(charArray)
def computeWithMetaphone(string: String) = Metaphone.compute(string)
def computeWithNysiis(charArray: Array[Char]) = Nysiis.compute(charArray)
def computeWithNysiis(string: String) = Nysiis.compute(string)
def computeWithRefinedNysiis(charArray: Array[Char]) = RefinedNysiis.compute(charArray)
def computeWithRefinedNysiis(string: String) = RefinedNysiis.compute(string)
def computeWithRefinedSoundex(charArray: Array[Char]) = RefinedSoundex.compute(charArray)
def computeWithRefinedSoundex(string: String) = RefinedSoundex.compute(string)
def computeWithSoundex(charArray: Array[Char]) = Soundex.compute(charArray)
def computeWithSoundex(string: String) = Soundex.compute(string)
}
|