Definition at line 21 of file Metaphone.cs.
Deveel.Data.Text.Metaphone.Metaphone |
( |
| ) |
|
|
inline |
string Deveel.Data.Text.Metaphone.Compute |
( |
string |
s | ) |
|
|
inline |
Definition at line 71 of file Metaphone.cs.
72 if (
string.IsNullOrEmpty(s))
79 char[] inwd = s.ToUpper().ToCharArray() ;
81 StringBuilder local =
new StringBuilder(40);
82 StringBuilder code =
new StringBuilder(10) ;
89 local.Append(inwd, 1, inwd.Length - 1);
96 local.Append(inwd, 1, inwd.Length - 1);
102 if (inwd[1] ==
'R') {
103 local.Append(inwd, 1, inwd.Length - 1);
106 if (inwd[1] ==
'H') {
107 local.Append(inwd, 1, inwd.Length - 1);
122 int wdsz = local.Length;
125 while ((code.Length <
this.maxCodeLen) &&
127 char symb = local[n];
133 case 'A' :
case 'E' :
case 'I' :
case 'O' :
case 'U' :
149 (this.
frontv.IndexOf(local[n + 1]) >= 0)) {
157 (this.
frontv.IndexOf(local[n + 1]) >= 0)) {
181 (this.
frontv.IndexOf(local[n + 2]) >= 0)) {
182 code.Append(
'J'); n += 2 ;
209 (this.
frontv.IndexOf(local[n + 1]) >= 0) &&
221 (this.
varson.IndexOf(local[n - 1]) >= 0)) {
285 case 'W' :
case 'Y' :
301 if (code.Length >
this.maxCodeLen) {
305 return code.ToString();
bool RegionMatch(StringBuilder sb, int index, String test)
bool IsVowel(StringBuilder sb, int index)
bool IsPreviousChar(StringBuilder sb, int index, char c)
bool IsNextChar(StringBuilder sb, int index, char c)
bool IsLastChar(int wdsz, int n)
bool Deveel.Data.Text.Metaphone.IsLastChar |
( |
int |
wdsz, |
|
|
int |
n |
|
) |
| |
|
inlineprivate |
bool Deveel.Data.Text.Metaphone.IsNextChar |
( |
StringBuilder |
sb, |
|
|
int |
index, |
|
|
char |
c |
|
) |
| |
|
inlineprivate |
Definition at line 61 of file Metaphone.cs.
63 if (index >= 0 && index < sb.Length - 1) {
64 matches = sb[index + 1] == c;
bool Deveel.Data.Text.Metaphone.IsPreviousChar |
( |
StringBuilder |
sb, |
|
|
int |
index, |
|
|
char |
c |
|
) |
| |
|
inlineprivate |
Definition at line 53 of file Metaphone.cs.
55 if( index > 0 && index < sb.Length) {
56 matches = sb[index - 1] == c;
bool Deveel.Data.Text.Metaphone.IsVowel |
( |
StringBuilder |
sb, |
|
|
int |
index |
|
) |
| |
|
inlineprivate |
bool Deveel.Data.Text.Metaphone.RegionMatch |
( |
StringBuilder |
sb, |
|
|
int |
index, |
|
|
String |
test |
|
) |
| |
|
inlineprivate |
Definition at line 39 of file Metaphone.cs.
42 (index + test.Length - 1) < sb.Length) {
43 string substring = sb.ToString(index, test.Length);
44 matches = substring.Equals(test);
string Deveel.Data.Text.Metaphone.frontv = "EIY" |
|
private |
int Deveel.Data.Text.Metaphone.maxCodeLen = 4 |
|
private |
string Deveel.Data.Text.Metaphone.varson = "CSPTG" |
|
private |
string Deveel.Data.Text.Metaphone.vowels = "AEIOU" |
|
private |
The documentation for this class was generated from the following file:
- /var/calculate/remote/distfiles/egit-src/deveeldb.git/src/deveeldb/Deveel.Data.Text/Metaphone.cs