We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f58e030 commit 81ffb59Copy full SHA for 81ffb59
functions/strings/metaphone.js
@@ -89,7 +89,7 @@ function metaphone(word, phones) {
89
}
90
} else if (nc === 'H') {
91
metaword += 'X';
92
- x++;
+ x += 1;
93
} else {
94
metaword += 'K';
95
@@ -202,16 +202,13 @@ function metaphone(word, phones) {
202
203
break;
204
case 'T':
205
- if (x + 1 <= wordlength) {
206
- if (nc === 'H') {
207
- metaword += '0';
208
- } else if (x + 2 <= wordlength && nc === 'I' && 'AO'.indexOf(nnc) !== -1) {
209
- metaword += 'X';
210
- } else {
211
- metaword += 'T';
212
- }
213
+ if (nc === 'I' && (nnc == 'O' || nnc === 'A')) {
+ metaword += 'X';
+ } else if (nc === 'H') {
+ metaword += '0';
+ } else if (word.substr(x + 1, 2) !== 'CH') {
214
metaword += 'T';
215
216
217
case 'W':
0 commit comments