summaryrefslogtreecommitdiffstats
path: root/extensions/spellcheck/hunspell/tests/unit/data/phone.aff
blob: 5a27c14d7e0b8ce0c2815e3cd64f79581ecfbdca (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# phonetic suggestions by PHONE and optional ph field of dictionary words
# Documentationo of PHONE: http://aspell.net/man-html/Phonetic-Code.html

#   phonetic_english.h - phonetic transformation rules for use with phonetic.c
#   Copyright (C) 2000 Björn Jacke
#
#   This rule set is based on Lawrence Phillips original metaphone 
#   algorithm with modifications made by Michael Kuhn in his
#   C implantation, more modifications by Björn Jacke when
#   converting the algorithm to a rule set and minor 
#   touch ups by Kevin Atkinson
#
#   This library is free software; you can redistribute it and/or
#   modify it under the terms of the GNU Lesser General Public
#   License version 2.1 as published by the Free Software Foundation;
#
#   This library is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   Lesser General Public License for more details.
#
#   You should have received a copy of the GNU Lesser General Public
#   License along with this library; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#   Björn Jacke may be reached by email at bjoern.jacke@gmx.de
#
#   Changelog:
#
#   2000-01-05  Björn Jacke <bjoern.jacke@gmx.de>
#               - first version with translation rules derived from
#                 metaphone.cc distributed with aspell 0.28.3
#               - "TH" is now representated as "@" because "0" is a
#                 meta character
#               - removed TH(!vowel) --> T; always use TH --> # instead
#               - dropped "^AE" -> "E" (redundant)
#               - "ing" is transformed to "N", not "NK"
#               - "SCH(EO)" transforms to "SK" now
#               - added R --> SILENT if (after a vowel) and no (vowel or
#                 "y" follows) like in "Marcy" or "abort"
#               - H is SILENT in RH at beginning of words
#               - H is SILENT if vowel leads and "Y" follows
#               - some ".OUGH.."  --> ...F exceptions added
#               - "^V" transforms to "W"
#   2000-01-07  Kevin Atkinson <kevinatk@home.com>
#               Converted from header to data file.
#
#   2007-08-23  László Németh <nemeth AT OOo>
#               Add PHONE header and PHONE keywords
#
# version 1.1

PHONE 105
PHONE AH(AEIOUY)-^         *H
PHONE AR(AEIOUY)-^         *R
PHONE A(HR)^               *
PHONE A^                   *
PHONE AH(AEIOUY)-          H
PHONE AR(AEIOUY)-          R
PHONE A(HR)                _
PHONE BB-                  _
PHONE B                    B
PHONE CQ-                  _
PHONE CIA                  X
PHONE CH                   X
PHONE C(EIY)-              S
PHONE CK                   K
PHONE COUGH^               KF
PHONE CC<                  C
PHONE C                    K
PHONE DG(EIY)              K
PHONE DD-                  _
PHONE D                    T
PHONE É<                   E
PHONE EH(AEIOUY)-^         *H
PHONE ER(AEIOUY)-^         *R
PHONE E(HR)^               *
PHONE ENOUGH^$             *NF
PHONE E^                   *
PHONE EH(AEIOUY)-          H
PHONE ER(AEIOUY)-          R
PHONE E(HR)                _
PHONE FF-                  _
PHONE F                    F
PHONE GN^                  N
PHONE GN$                  N
PHONE GNS$                 NS
PHONE GNED$                N
PHONE GH(AEIOUY)-          K
PHONE GH                   _
PHONE GG9                  K
PHONE G                    K
PHONE H                    H
PHONE IH(AEIOUY)-^         *H
PHONE IR(AEIOUY)-^         *R
PHONE I(HR)^               *
PHONE I^                   *
PHONE ING6                 N
PHONE IH(AEIOUY)-          H
PHONE IR(AEIOUY)-          R
PHONE I(HR)                _
PHONE J                    K
PHONE KN^                  N
PHONE KK-                  _
PHONE K                    K
PHONE LAUGH^               LF
PHONE LL-                  _
PHONE L                    L
PHONE MB$                  M
PHONE MM                   M
PHONE M                    M
PHONE NN-                  _
PHONE N                    N
PHONE OH(AEIOUY)-^         *H
PHONE OR(AEIOUY)-^         *R
PHONE O(HR)^               *
PHONE O^                   *
PHONE OH(AEIOUY)-          H
PHONE OR(AEIOUY)-          R
PHONE O(HR)                _
PHONE PH                   F
PHONE PN^                  N
PHONE PP-                  _
PHONE P                    P
PHONE Q                    K
PHONE RH^                  R
PHONE ROUGH^               RF
PHONE RR-                  _
PHONE R                    R
PHONE SCH(EOU)-            SK
PHONE SC(IEY)-             S
PHONE SH                   X
PHONE SI(AO)-              X
PHONE SS-                  _
PHONE S                    S
PHONE TI(AO)-              X
PHONE TH                   @
PHONE TCH--                _
PHONE TOUGH^               TF
PHONE TT-                  _
PHONE T                    T
PHONE UH(AEIOUY)-^         *H
PHONE UR(AEIOUY)-^         *R
PHONE U(HR)^               *
PHONE U^                   *
PHONE UH(AEIOUY)-          H
PHONE UR(AEIOUY)-          R
PHONE U(HR)                _
PHONE V^                   W
PHONE V                    F
PHONE WR^                  R
PHONE WH^                  W
PHONE W(AEIOU)-            W
PHONE X^                   S
PHONE X                    KS
PHONE Y(AEIOU)-            Y
PHONE ZZ-                  _
PHONE Z                    S

#The rules in a different view:
#
# Exceptions:
#
#  Beginning of word: "gn", "kn-", "pn-", "wr-"  ----> drop first letter
#                     "Aebersold", "Gnagy", "Knuth", "Pniewski", "Wright"
#
#  Beginning of word: "x"                                ----> change to "s"
#                                     as in "Deng Xiaopeng"
#
#  Beginning of word: "wh-"                              ----> change to "w"
#                                     as in "Whalen"
#  Beginning of word: leading vowels are transformed to "*"
#
#  "[crt]ough" and "enough" are handled separately because of "F" sound
#
#
#  A --> A      at beginning
#          _      otherwise
#
#  B --> B      unless at the end of word after "m", as in "dumb", "McComb"
#
#  C --> X      (sh) if "-cia-" or "-ch-"
#          S      if "-ci-", "-ce-", or "-cy-"
#                 SILENT if "-sci-", "-sce-", or "-scy-", or "-cq-"
#          K      otherwise, including in "-sch-"
#
#  D --> K      if in "-dge-", "-dgy-", or "-dgi-"
#          T      otherwise
#
#  E --> A      at beginnig
#          _      SILENT otherwise
#  
#  F --> F
#
#  G -->        SILENT if in "-gh-" and not at end or before a vowel
#                            in "-gn" or "-gned" or "-gns"
#                           in "-dge-" etc., as in above rule
#          K      if before "i", or "e", or "y" if not double "gg"
#
#          K      otherwise (incl. "GG"!)
#
#  H -->        SILENT if after vowel and no vowel or "Y" follows
#                        or after "-ch-", "-sh-", "-ph-", "-th-", "-gh-"
#                        or after "rh-" at beginning
#          H      otherwise
#
#  I --> A      at beginning
#          _      SILENT otherwise
#
#  J --> K
#
#  K -->        SILENT if after "c"
#          K      otherwise
#
#  L --> L
#
#  M --> M
#  
#  N --> N
#
#  O --> A      at beginning
#          _      SILENT otherwise
#
#  P --> F      if before "h"
#          P      otherwise
#
#  Q --> K
#
#  R -->        SILENT if after vowel and no vowel or "Y" follows
#          R      otherwise
#
#  S --> X      (sh) if before "h" or in "-sio-" or "-sia-"
#          SK     if followed by "ch(eo)" (SCH(EO))
#          S      otherwise
#
#  T --> X      (sh) if "-tia-" or "-tio-"
#          0      (th) if before "h"
#                 silent if in "-tch-"
#          T      otherwise
#
#  U --> A      at beginning
#          _      SILENT otherwise
#
#  V --> V      if first letter of word
#          F      otherwise
#
#  W -->        SILENT if not followed by a vowel
#          W      if followed by a vowel
#
#  X --> KS
#
#  Y -->        SILENT if not followed by a vowel
#          Y      if followed by a vowel
# 
#  Z --> S