phonetic 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +98 -0
- data/Rakefile +1 -0
- data/lib/phonetic.rb +10 -0
- data/lib/phonetic/algorithm.rb +24 -0
- data/lib/phonetic/caverphone.rb +68 -0
- data/lib/phonetic/caverphone2.rb +69 -0
- data/lib/phonetic/core_ext/string.rb +3 -0
- data/lib/phonetic/core_ext/string/caverphone.rb +11 -0
- data/lib/phonetic/core_ext/string/caverphone2.rb +11 -0
- data/lib/phonetic/core_ext/string/double_metaphone.rb +18 -0
- data/lib/phonetic/core_ext/string/metaphone.rb +12 -0
- data/lib/phonetic/core_ext/string/nysiis.rb +12 -0
- data/lib/phonetic/core_ext/string/refined_soundex.rb +12 -0
- data/lib/phonetic/core_ext/string/soundex.rb +12 -0
- data/lib/phonetic/double_metaphone.rb +640 -0
- data/lib/phonetic/metaphone.rb +161 -0
- data/lib/phonetic/metaphone2.rb +5 -0
- data/lib/phonetic/nysiis.rb +63 -0
- data/lib/phonetic/refined_soundex.rb +39 -0
- data/lib/phonetic/soundex.rb +39 -0
- data/lib/phonetic/version.rb +3 -0
- data/phonetic.gemspec +26 -0
- data/spec/phonetic/algorithm_spec.rb +15 -0
- data/spec/phonetic/caverphone2_spec.rb +66 -0
- data/spec/phonetic/caverphone_spec.rb +115 -0
- data/spec/phonetic/core_ext/string/caverphone2_spec.rb +9 -0
- data/spec/phonetic/core_ext/string/caverphone_spec.rb +9 -0
- data/spec/phonetic/core_ext/string/double_metaphone_spec.rb +15 -0
- data/spec/phonetic/core_ext/string/metaphone_spec.rb +11 -0
- data/spec/phonetic/core_ext/string/nysiis_spec.rb +12 -0
- data/spec/phonetic/core_ext/string/refined_soundex_spec.rb +10 -0
- data/spec/phonetic/core_ext/string/soundex_spec.rb +14 -0
- data/spec/phonetic/double_metaphone_spec.rb +16 -0
- data/spec/phonetic/metaphone2_spec.rb +9 -0
- data/spec/phonetic/metaphone_spec.rb +81 -0
- data/spec/phonetic/nysiis_spec.rb +20 -0
- data/spec/phonetic/refined_soundex_spec.rb +13 -0
- data/spec/phonetic/soundex_spec.rb +24 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/support/double_metaphone_data.rb +142 -0
- data/spec/support/nysiis_data.rb +31 -0
- metadata +180 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'phonetic'
|
2
|
+
|
3
|
+
describe String do
|
4
|
+
describe '#double_metaphone' do
|
5
|
+
it 'should return Double Metaphone code of string' do
|
6
|
+
'Gelatin'.double_metaphone.should == ['KLTN', 'JLTN']
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#metaphone2' do
|
11
|
+
it 'should return Double Metaphone code of string' do
|
12
|
+
'whirlpool'.metaphone2.should == ['ARLP', 'ARLP']
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'support/nysiis_data'
|
3
|
+
|
4
|
+
describe String do
|
5
|
+
describe '#nysiis' do
|
6
|
+
it 'should return NYSIIS code of word' do
|
7
|
+
Phonetic::NYSIIS_TEST_TABLE.each do |word, result|
|
8
|
+
word.nysiis(trim: false).should == result
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe String do
|
4
|
+
describe '#refined_soundex' do
|
5
|
+
it 'should return refined soundex code of word' do
|
6
|
+
'Braz Caren Hayers'.refined_soundex.should == 'B1905 C30908 H093'
|
7
|
+
'Lambard Noulton'.refined_soundex.should == 'L7081096 N807608'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe String do
|
4
|
+
describe '#soundex' do
|
5
|
+
it 'should return soundex code of word' do
|
6
|
+
'Ackerman'.soundex.should == 'A265'
|
7
|
+
'Fusedale'.soundex.should == 'F234'
|
8
|
+
'Grahl'.soundex.should == 'G640'
|
9
|
+
'Hatchard'.soundex.should == 'H326'
|
10
|
+
'implementation'.soundex.should == 'I514'
|
11
|
+
'Prewett'.soundex.should == 'P630'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'support/double_metaphone_data'
|
3
|
+
|
4
|
+
describe Phonetic::DoubleMetaphone do
|
5
|
+
describe '.encode' do
|
6
|
+
it 'should return Double Metaphone codes of string' do
|
7
|
+
Phonetic::DOUBLE_METAPHONE_TEST_TABLE.each do |w, r|
|
8
|
+
Phonetic::DoubleMetaphone.encode(w).should == r
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should support max size of the code option' do
|
13
|
+
Phonetic::DoubleMetaphone.encode('accede', size: 3).should == ['AKS', 'AKS']
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Phonetic::Metaphone do
|
4
|
+
describe '.encode' do
|
5
|
+
it 'should drop duplicate adjacent letters, except for C' do
|
6
|
+
Phonetic::Metaphone.encode('Accola Nikki Dillon').should == 'AKKL NK TLN'
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should drop the first letter if the word begins with KN, GN, PN, AE, WR' do
|
10
|
+
Phonetic::Metaphone.encode('Knapp Gnome Phantom Aeneid Wright').should == 'NP NM FNTM ENT RT'
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should drop B if after M at the end of the word' do
|
14
|
+
Phonetic::Metaphone.encode('Plumb Amber').should == 'PLM AMBR'
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should transform CIA to XIA' do
|
18
|
+
Phonetic::Metaphone.encode('Ciara Phylicia').should == 'XR FLX'
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should transform CH to X if it is not the part of -SCH-' do
|
22
|
+
Phonetic::Metaphone.encode('Dratch Heche Christina').should == 'TRX HX KRST'
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should transform -SCH- to -SKH-' do
|
26
|
+
Phonetic::Metaphone.encode('School Deschanel').should == 'SKL TSKN'
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should transform C to S if followed by I, E, or Y. And to K otherwise' do
|
30
|
+
Phonetic::Metaphone.encode('Felicity Joyce Nancy Carol C').should == 'FLST JS NNS KRL K'
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should transform D to J if followed by GE, GY, or GI. And to T otherwise' do
|
34
|
+
Phonetic::Metaphone.encode('Coolidge Lodgy Dixie Pidgin D').should == 'KLJ LJ TKS PJN T'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should drop G if followed by H and H is not at the end or before a vowel' do
|
38
|
+
Phonetic::Metaphone.encode('Knight Clayburgh Haughton Monaghan').should == 'NT KLBR HTN MNKN'
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should transform G to J if before I, E, or Y, and to K other otherwise' do
|
42
|
+
Phonetic::Metaphone.encode('Gigi Gena Peggy Gyllenhaal Madigan G').should == 'JJ JN PK JLNH MTKN K'
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'should drop G if followed by N or NED and is at the end' do
|
46
|
+
Phonetic::Metaphone.encode('GN GNE GNED Agnes Signed').should == 'N N NT ANS SNT'
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'should drop H if after vowel and not before a vowel' do
|
50
|
+
Phonetic::Metaphone.encode('Sarah Shahi Moorehead Poehler').should == 'SR XH MRHT PLR'
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'should transform CK to K, PH to F, Q to K, V to F, Z to S' do
|
54
|
+
Phonetic::Metaphone.encode('Acker Sophia Quinn Victoria Zelda Karen').should == 'AKR SF KN FKTR SLT KRN'
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'should transform SH to XH, SIO to XIO, SIA to XIA' do
|
58
|
+
Phonetic::Metaphone.encode('Ashley Siobhan Siamese').should == 'AXL XBHN XMS'
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should transform TIA to XIA, TIO to XIO, TH to 0, TCH to CH' do
|
62
|
+
Phonetic::Metaphone.encode('Tia Portia Interaction Catherine Dratch Fletcher').should == 'X PRX INTR K0RN TRX FLXR'
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'should transform WH to W at the beginning, drop W if not followed by a vowel' do
|
66
|
+
Phonetic::Metaphone.encode('Whoopi Goodwin Harlow Hawley').should == 'WP KTWN HRL HL'
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'should transform X to S at the beginning and X to KS otherwise' do
|
70
|
+
Phonetic::Metaphone.encode('Xor Alexis X').should == 'SR ALKS S'
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'should drop Y if not followed by a vowel' do
|
74
|
+
Phonetic::Metaphone.encode('Yasmine Blonsky Blyth').should == 'YSMN BLNS BL0'
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'should drop all vowels unless it is the beginning' do
|
78
|
+
Phonetic::Metaphone.encode('Boardman Mary Ellen').should == 'BRTM MR ELN'
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'support/nysiis_data'
|
3
|
+
|
4
|
+
describe Phonetic::NYSIIS do
|
5
|
+
describe '.encode' do
|
6
|
+
it 'should return NYSIIS code of word' do
|
7
|
+
Phonetic::NYSIIS_TEST_TABLE.each do |word, result|
|
8
|
+
Phonetic::NYSIIS.encode(word, trim: false).should == result
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should return empty string for empty word' do
|
13
|
+
Phonetic::NYSIIS.encode('').should == ''
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should ignore non-english symbols in input' do
|
17
|
+
Phonetic::NYSIIS.encode('1234567890+-= Bess $').should == 'BAS'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Phonetic::RefinedSoundex do
|
4
|
+
describe '.encode' do
|
5
|
+
it 'should return refined soundex code of word' do
|
6
|
+
Phonetic::RefinedSoundex.encode('Braz').should == 'B1905'
|
7
|
+
Phonetic::RefinedSoundex.encode('Caren').should == 'C30908'
|
8
|
+
Phonetic::RefinedSoundex.encode('Hayers').should == 'H093'
|
9
|
+
Phonetic::RefinedSoundex.encode('Lambard').should == 'L7081096'
|
10
|
+
Phonetic::RefinedSoundex.encode('Noulton').should == 'N807608'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Phonetic::Soundex do
|
4
|
+
describe '.encode' do
|
5
|
+
it 'should return soundex code of word' do
|
6
|
+
Phonetic::Soundex.encode('Ackerman').should == 'A265'
|
7
|
+
Phonetic::Soundex.encode('Fusedale').should == 'F234'
|
8
|
+
Phonetic::Soundex.encode('Grahl').should == 'G640'
|
9
|
+
Phonetic::Soundex.encode('Hatchard').should == 'H326'
|
10
|
+
Phonetic::Soundex.encode('implementation').should == 'I514'
|
11
|
+
Phonetic::Soundex.encode('Prewett').should == 'P630'
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should add zeros if result less then 4 symbols' do
|
15
|
+
Phonetic::Soundex.encode('ammonium').should == 'A500'
|
16
|
+
Phonetic::Soundex.encode('Rubin').should == 'R150'
|
17
|
+
Phonetic::Soundex.encode('H').should == 'H000'
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should return empty string for empty word' do
|
21
|
+
Phonetic::Soundex.encode('').should == ''
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.start
|
3
|
+
|
4
|
+
require 'phonetic'
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
8
|
+
config.run_all_when_everything_filtered = true
|
9
|
+
config.filter_run :focus
|
10
|
+
config.order = 'random'
|
11
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Phonetic
|
4
|
+
DOUBLE_METAPHONE_TEST_TABLE = {
|
5
|
+
'accede' => ['AKST', 'AKST'],
|
6
|
+
'accident' => ['AKST', 'AKST'],
|
7
|
+
'avvenente' => ['AFNN', 'AFNN'],
|
8
|
+
'Acker' => ['AKR', 'AKR'],
|
9
|
+
'Agnes' => ['AKNS', 'ANS'],
|
10
|
+
'Akkad' => ['AKT', 'AKT'],
|
11
|
+
'Alicia' => ['ALS', 'ALX'],
|
12
|
+
'Allasio' => ['ALS', 'ALX'],
|
13
|
+
'aqqa' => ['AK', 'AK'],
|
14
|
+
'arch' => ['ARX', 'ARK'],
|
15
|
+
'architect' => ['ARKT', 'ARKT'],
|
16
|
+
'Arnoff' => ['ARNF', 'ARNF'],
|
17
|
+
'Arnow' => ['ARN', 'ARNF'],
|
18
|
+
'Assia' => ['AS', 'AS'],
|
19
|
+
'artois' => ['ART', 'ARTS'],
|
20
|
+
'bacchus' => ['PKS', 'PKS'],
|
21
|
+
'bacci' => ['PX', 'PX'],
|
22
|
+
'bajador' => ['PJTR', 'PHTR'],
|
23
|
+
'Bajja' => ['PJ', 'PJ'],
|
24
|
+
'Barzizza' => ['PRSS', 'PRST'],
|
25
|
+
'bellocchio' => ['PLX', 'PLX'],
|
26
|
+
'bertucci' => ['PRTX', 'PRTX'],
|
27
|
+
'biaggi' => ['PJ', 'PK'],
|
28
|
+
'breaux' => ['PR', 'PR'],
|
29
|
+
'braço' => ['PRS', 'PRS'],
|
30
|
+
'cabrillo' => ['KPRL', 'KPR'],
|
31
|
+
'Cacgia' => ['KK', 'KK'],
|
32
|
+
'caesar' => ['SSR', 'SSR'],
|
33
|
+
'cagney' => ['KKN', 'KKN'],
|
34
|
+
'campbell' => ['KMPL', 'KMPL'],
|
35
|
+
'carlisle' => ['KRLL', 'KRLL'],
|
36
|
+
'carlysle' => ['KRLL', 'KRLL'],
|
37
|
+
'chemistry' => ['KMST', 'KMST'],
|
38
|
+
'cherry' => ['XR', 'XR'],
|
39
|
+
'chianti' => ['KNT', 'KNT'],
|
40
|
+
'chorus' => ['KRS', 'KRS'],
|
41
|
+
'Cielo' => ['SL', 'XL'],
|
42
|
+
'Cioccolato' => ['SKLT', 'XKLT'],
|
43
|
+
'cough' => ['KF', 'KF'],
|
44
|
+
'czerny' => ['SRN', 'XRN'],
|
45
|
+
'dumb' => ['TM', 'TM'],
|
46
|
+
'edgar' => ['ATKR', 'ATKR'],
|
47
|
+
'edge' => ['AJ', 'AJ'],
|
48
|
+
'exam' => ['AKSM', 'AKSM'],
|
49
|
+
'exceed' => ['AKST', 'AKST'],
|
50
|
+
'filipowicz' => ['FLPT', 'FLPF'],
|
51
|
+
'focaccia' => ['FKX', 'FKX'],
|
52
|
+
'gallegos' => ['KLKS', 'KKS'],
|
53
|
+
'Gebal' => ['KPL', 'JPL'],
|
54
|
+
'Gelatin' => ['KLTN', 'JLTN'],
|
55
|
+
'Gepard' => ['KPRT', 'JPRT'],
|
56
|
+
'Gerald' => ['KRLT', 'JRLT'],
|
57
|
+
'Gesture' => ['KSTR', 'JSTR'],
|
58
|
+
'geyser' => ['KSR', 'JSR'],
|
59
|
+
'ghiradelli' => ['JRTL', 'JRTL'],
|
60
|
+
'ghislane' => ['JLN', 'JLN'],
|
61
|
+
'ghost' => ['KST', 'KST'],
|
62
|
+
'gibbon' => ['KPN', 'JPN'],
|
63
|
+
'Gilbert' => ['KLPR', 'JLPR'],
|
64
|
+
'ginger' => ['KNKR', 'JNJR'],
|
65
|
+
'Giethoorn' => ['K0RN', 'JTRN'],
|
66
|
+
'gough' => ['KF', 'KF'],
|
67
|
+
'Grashof' => ['KRXF', 'KRXF'],
|
68
|
+
'hochmeier' => ['HKMR', 'HKMR'],
|
69
|
+
'hugh' => ['H', 'H'],
|
70
|
+
'island' => ['ALNT', 'ALNT'],
|
71
|
+
'isle' => ['AL', 'AL'],
|
72
|
+
'Jankelowicz' => ['JNKL', 'ANKL'],
|
73
|
+
'Jacqueline' => ['JKLN', 'AKLN'],
|
74
|
+
'dejer' => ['TJR', 'TJR'],
|
75
|
+
'jose' => ['HS', 'HS'],
|
76
|
+
'joseph' => ['JSF', 'HSF'],
|
77
|
+
'Jugnot' => ['JNT', 'AKNT'],
|
78
|
+
'Katerine' => ['KTRN', 'KTRN'],
|
79
|
+
'laugh' => ['LF', 'LF'],
|
80
|
+
'Lawrence' => ['LRNS', 'LRNS'],
|
81
|
+
'Loretta' => ['LRT', 'LRT'],
|
82
|
+
'mac caffrey' => ['MKFR', 'MKFR'],
|
83
|
+
'mac gregor' => ['MKRK', 'MKRK'],
|
84
|
+
'Maggie' => ['MJ', 'MK'],
|
85
|
+
'maña' => ['MN', 'MN'],
|
86
|
+
'McClellan' => ['MKLL', 'MKLL'],
|
87
|
+
'McHugh' => ['MK', 'MK'],
|
88
|
+
'McLaughlin' => ['MKLF', 'MKLF'],
|
89
|
+
'michael' => ['MKL', 'MXL'],
|
90
|
+
'Monaghan' => ['MNKN','MNKN'],
|
91
|
+
'Moosholzer' => ['MSLS', 'MSLS'],
|
92
|
+
'Mosheim' => ['MSM', 'MSM'],
|
93
|
+
'nation' => ['NXN', 'NXN'],
|
94
|
+
'orchestra' => ['ARKS', 'ARKS'],
|
95
|
+
'orchid' => ['ARKT', 'ARKT'],
|
96
|
+
'quest' => ['KST', 'KST'],
|
97
|
+
'pizza' => ['PS', 'PTS'],
|
98
|
+
'Portia' => ['PRX', 'PRX'],
|
99
|
+
'raspberry' => ['RSPR', 'RSPR'],
|
100
|
+
'resnais' => ['RSN', 'RSNS'],
|
101
|
+
'Rogge' => ['RK', 'RK'],
|
102
|
+
'rogier' => ['RJ', 'RJR'],
|
103
|
+
'rough' => ['RF', 'RF'],
|
104
|
+
'raj' => ['RJ', 'R'],
|
105
|
+
'san jacinto' => ['SNHS', 'SNHS'],
|
106
|
+
'Scarlett' => ['SKRL', 'SKRL'],
|
107
|
+
'schenker' => ['XNKR', 'SKNK'],
|
108
|
+
'schermerhorn' => ['XRMR', 'SKRM'],
|
109
|
+
'schmidt' => ['XMT', 'SMT'],
|
110
|
+
'schneider' => ['XNTR', 'SNTR'],
|
111
|
+
'school' => ['SKL', 'SKL'],
|
112
|
+
'schooner' => ['SKNR', 'SKNR'],
|
113
|
+
'Sciorra' => ['SR', 'SR'],
|
114
|
+
'Sholman' => ['SLMN', 'SLMN'],
|
115
|
+
'Shoeka' => ['SK', 'SK'],
|
116
|
+
'smith' => ['SM0', 'XMT'],
|
117
|
+
'snider' => ['SNTR', 'XNTR'],
|
118
|
+
'succeed' => ['SKST', 'SKST'],
|
119
|
+
'sugar' => ['XKR', 'SKR'],
|
120
|
+
'szamos' => ['SMS', 'XMS'],
|
121
|
+
'tagliaro' => ['TKLR', 'TLR'],
|
122
|
+
'thames' => ['TMS', 'TMS'],
|
123
|
+
'thomas' => ['TMS', 'TMS'],
|
124
|
+
'thumb' => ['0M', 'TM'],
|
125
|
+
'tichner' => ['TXNR', 'TKNR'],
|
126
|
+
'tough' => ['TF', 'TF'],
|
127
|
+
'Uomo' => ['AM', 'AM'],
|
128
|
+
'van gelder' => ['FNKL', 'FNKL'],
|
129
|
+
'Vasserman' => ['FSRM', 'FSRM'],
|
130
|
+
'wachtler' => ['AKTL', 'FKTL'],
|
131
|
+
'Wasserman' => ['ASRM', 'FSRM'],
|
132
|
+
'weschsler' => ['AXSL', 'FXSL'],
|
133
|
+
'Wesia' => ['AS', 'FS'],
|
134
|
+
'Womo' => ['AM', 'FM'],
|
135
|
+
'Winningham' => ['ANNK', 'FNNK'],
|
136
|
+
'whirlpool' => ['ARLP', 'ARLP'],
|
137
|
+
'wright' => ['RT', 'RT'],
|
138
|
+
'Xavier' => ['SF', 'SFR'],
|
139
|
+
'Yankelovich' => ['ANKL', 'ANKL'],
|
140
|
+
'zhao' => ['J', 'J']
|
141
|
+
}
|
142
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Phonetic
|
2
|
+
NYSIIS_TEST_TABLE = {
|
3
|
+
'Alexandra' => 'ALAXANDR',
|
4
|
+
'Aumont' => 'AANAD',
|
5
|
+
'Bonnie' => 'BANY',
|
6
|
+
'Christensen' => 'CHRASTANSAN',
|
7
|
+
'Cleveland' => 'CLAFALAD',
|
8
|
+
'Claudia' => 'CLAD',
|
9
|
+
'Dedee' => 'DADY',
|
10
|
+
'DeLaurentiis' => 'DALARANT',
|
11
|
+
'Echikunwoke' => 'ECACANWAC',
|
12
|
+
'Fahey' => 'FAHY',
|
13
|
+
'Jacqueline' => 'JACGALAN',
|
14
|
+
'John' => 'J',
|
15
|
+
'Hessel' => 'HASAL',
|
16
|
+
'Hubert' => 'HABAD',
|
17
|
+
'Howard' => 'HAD',
|
18
|
+
'Knuth' => 'NNAT',
|
19
|
+
'Kepler' => 'CAPLAR',
|
20
|
+
'Marguerite' => 'MARGARAT',
|
21
|
+
'Smith' => 'SNAT',
|
22
|
+
'Schelte' => 'SSALT',
|
23
|
+
'Macdonald' => 'MCDANALD',
|
24
|
+
'Michael' => 'MACAL',
|
25
|
+
'Phoenix' => 'FFANAX',
|
26
|
+
'Pfeiffer' => 'FFAFAR',
|
27
|
+
'Rebecca' => 'RABAC',
|
28
|
+
'Rosalind' => 'RASALAD',
|
29
|
+
'Schmidt' => 'SSNAD'
|
30
|
+
}
|
31
|
+
end
|