interscript-maps 3.0.0 → 3.1.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.
@@ -0,0 +1,673 @@
1
+ system "ALA-LC:jpn-Hrkt:Latn:2022" {
2
+
3
+ metadata {
4
+ authority_id alalc
5
+ id 2022
6
+ language iso-639-2:jpn
7
+ source_script Hrkt
8
+ destination_script Latn
9
+ name "Japanese Romanization Table (2022)"
10
+ url https://www.loc.gov/catdir/cpso/romanization/japanese.pdf
11
+ creation_date 2022
12
+ adoption_date
13
+ description { ALA-LC Japanese Romanization Table, 2022 version
14
+ (McCune-Reischauer). Encodes the Romanized/Kana Equivalent Charts
15
+ (chart A, Standard; chart B, Non-traditional Japanese for foreign
16
+ words) kana-by-kana, per section 2.1 ("words and parts of words
17
+ written only in hiragana or katakana should be romanized as they
18
+ appear") and section 2.4.2.1 ("Romanize kana-by-kana"), together
19
+ with the deterministic orthographic rules of the same document: the
20
+ lengthening-bar macron rule (2.5.1), the sokuon doubling rule
21
+ (chart A note ii), the n-apostrophe rule (5.2), the kana repetition
22
+ markers (4.4.1) and the punctuation and typographical equivalents
23
+ (4.2-4.3). Transcribed from the loc.gov document's complete text
24
+ layer. }
25
+
26
+ notes {
27
+ note "Kanji readings are the non-deterministic remainder of this
28
+ system (kanji entries were marked M for multiple readings in
29
+ earlier editions of this table): sections 2.2-2.4 direct the
30
+ cataloger to preferred readings from standard dictionaries,
31
+ well-established readings of proper names, and loan-word
32
+ conventions. This map covers the deterministic kana tables only."
33
+ note "Long vowels written without a lengthening bar are a
34
+ documented remainder: they merge into a macron only within a
35
+ morpheme (2.5.5), and the document itself attests identical kana
36
+ strings with different outputs (こうし as Kōshi in 孔子, merged, and
37
+ as koushi in 子牛, unmerged). This map therefore romanizes
38
+ kana-by-kana (こう -> ou), which is the document's stated primary
39
+ mode for kana (2.4.2.1; e.g. スタア sutaa, ジイサン jiisan, びいどろ
40
+ biidoro, ジウム jiumu). The lengthening bar ー is deterministic
41
+ (2.5.1: vowels written with a lengthening bar are romanized with a
42
+ macron) and is encoded; long i is doubled ii except after the bar
43
+ (2.5.4: ジイサン jiisan, ビードロ bīdoro)."
44
+ note "Particle readings are a documented remainder: は and へ used
45
+ as grammatical particles romanize wa and e (chart A note i; section
46
+ 2.3.1). Reading the particle requires parsing, so this map gives
47
+ the chart values ha and he."
48
+ note "Capitalization (section 3) and word division (section 6) are
49
+ cataloging-level rules operating above the character mapping and
50
+ are not encoded; this map outputs lowercase romanization with no
51
+ word division."
52
+ note "Chart A 'Other Romanization Styles' footnote markers, shown
53
+ for reference only and not encoded: 1 shi (si in Kunrei, Nippon);
54
+ 2 chi, tsu (ti, tu in Kunrei, Nippon); 3 fu (hu in Kunrei, Nippon);
55
+ 4 を/ヲ 'Always o regardless of usage'; 5 ん/ン 'Always n (Do not
56
+ change to m as in Hepburn)'; 6 ji (zi in Kunrei, Nippon); 7 ji, zu
57
+ (zi, zu in Kunrei; di, du in Nippon); 8 sha, shu, sho (sya, syu,
58
+ syo in Kunrei, Nippon); 9 cha, chu, cho (tya, tyu, tyo in Kunrei,
59
+ Nippon); 10 ja, ju, jo (zya, zyu, zyo in Kunrei, Nippon); 11 ja,
60
+ ju, jo (zya, zyu, zyo in Kunrei; dya, dyu, dyo in Nippon). The
61
+ ALA-LC forms are the ones encoded."
62
+ note "Chart A also maps the C + small-い cells to a macron i as
63
+ printed (きぃ/キィ ki with macron; likewise ni, hi, mi, ri, gi, bi,
64
+ pi rows), and the ぁ/ぉ small-kana cells of the ki, hi, bi, pi rows
65
+ (きぁ kya, ひぉ hyo, びぉ byo, ぴぉ pyo). Chart B note iii directs
66
+ that large character-small character sequences not found in the
67
+ tables be romanized as if the added small characters were regular
68
+ characters (e.g. アィ ai, スェ sue, ヴィァ via); this map realizes
69
+ the rule by folding the standalone small vowels ぁぃぅぇぉ ァィゥェォ
70
+ to their regular equivalents."
71
+ note "Recorded but not encoded: the middle dot (4.1: comma plus
72
+ space or only a space, depending on clarity), the kanji iteration
73
+ mark 々 of the 4.4.1 examples (chōchō, hibi, nennen - kanji-level
74
+ repetition), and the geta placeholder (4.4.2, cataloger supplies
75
+ the reading in brackets). Section 2.3.2 (historical kana usage) is
76
+ covered by the kana-by-kana mode: direct kana-by-kana reading gives
77
+ the suggested variant forms (てふてふ tefutefu)."
78
+ note "The document contradicts itself on スェ: chart B prints the
79
+ row すぇ/スェ -> swe, while chart B note iii's worked example
80
+ prints スェ | sue. The chart row is operative here (swe); the note
81
+ iii examples アィ -> ai and ヴィァ -> via are consistent and encoded
82
+ through the small-kana fold."
83
+ }
84
+ }
85
+
86
+ tests {
87
+ # Chart A cells (the table itself; distinctive rows).
88
+ "きゃ" -> "kya"
89
+ "きぁ" -> "kya"
90
+ "きぃ" -> "kī"
91
+ "キィ" -> "kī"
92
+ "しゃ" -> "sha"
93
+ "しぇ" -> "she"
94
+ "ちゃ" -> "cha"
95
+ "ちぇ" -> "che"
96
+ "にぃ" -> "nī"
97
+ "にぇ" -> "nye"
98
+ "ひぇ" -> "hye"
99
+ "ひぉ" -> "hyo"
100
+ "みぃ" -> "mī"
101
+ "りぃ" -> "rī"
102
+ "ぎぃ" -> "gī"
103
+ "ぢゃ" -> "ja"
104
+ "ぢゅ" -> "ju"
105
+ "ぢぇ" -> "je"
106
+ "びぃ" -> "bī"
107
+ "びぉ" -> "byo"
108
+ "ぴぃ" -> "pī"
109
+ "ぴょ" -> "pyo"
110
+ "ぴぉ" -> "pyo"
111
+ "ゐ" -> "i"
112
+ "ゑ" -> "e"
113
+ "ヰ" -> "i"
114
+ "ヱ" -> "e"
115
+ "を" -> "o"
116
+ "ヲ" -> "o"
117
+ "ぢ" -> "ji"
118
+ "づ" -> "zu"
119
+ "ヂ" -> "ji"
120
+ "ヅ" -> "zu"
121
+ "ふ" -> "fu"
122
+ "し" -> "shi"
123
+ "ち" -> "chi"
124
+ "つ" -> "tsu"
125
+ "じ" -> "ji"
126
+ "ん" -> "n"
127
+ "ン" -> "n"
128
+ "ア" -> "a"
129
+ "シ" -> "shi"
130
+ # Chart B cells.
131
+ "いぇ" -> "ye"
132
+ "うぁ" -> "wa"
133
+ "うぃ" -> "wi"
134
+ "うぇ" -> "we"
135
+ "うぉ" -> "wo"
136
+ "くぁ" -> "kwa"
137
+ "くぃ" -> "kwi"
138
+ "くぇ" -> "kwe"
139
+ "くぉ" -> "kwo"
140
+ "すぃ" -> "si"
141
+ "すぇ" -> "swe"
142
+ "ぐぁ" -> "gwa"
143
+ "ぐぃ" -> "gwi"
144
+ "ぐぇ" -> "gwe"
145
+ "ぐぉ" -> "gwo"
146
+ "ずぃ" -> "zi"
147
+ "つぁ" -> "tsa"
148
+ "つぃ" -> "tsi"
149
+ "つぇ" -> "tse"
150
+ "つぉ" -> "tso"
151
+ "てぃ" -> "ti"
152
+ "とぅ" -> "tu"
153
+ "てゅ" -> "tyu"
154
+ "ふぁ" -> "fa"
155
+ "ふぃ" -> "fi"
156
+ "ふゅ" -> "fyu"
157
+ "ふぇ" -> "fe"
158
+ "ふぉ" -> "fo"
159
+ "ふぃぇ" -> "fye"
160
+ "ふょ" -> "fyo"
161
+ "ヴァ" -> "va"
162
+ "ヴィ" -> "vi"
163
+ "ヴ" -> "vu"
164
+ "ヴェ" -> "ve"
165
+ "ヴォ" -> "vo"
166
+ "ヴュ" -> "vyu"
167
+ "でぃ" -> "di"
168
+ "どぅ" -> "du"
169
+ "でゅ" -> "dyu"
170
+ # Chart B note iii examples (as printed; the スェ example contradicts
171
+ # the chart B row swe - see notes).
172
+ "アィ" -> "ai"
173
+ "ヴィァ" -> "via"
174
+ # Document examples, 2.4.2.1 (kana-by-kana primary forms).
175
+ "コミユニテイ" -> "komiyunitei"
176
+ "スタア" -> "sutaa"
177
+ "テレビジオン" -> "terebijion"
178
+ "シンポジウム" -> "shinpojiumu"
179
+ "シンポジューム" -> "shinpojūmu"
180
+ # 2.5.1 lengthening bar -> macron.
181
+ "コンピュータ" -> "konpyūta"
182
+ "ウィーク" -> "wīku"
183
+ "ビードロ" -> "bīdoro"
184
+ "そーっと" -> "sōtto"
185
+ # 2.5.4 long i doubled; after the bar, the macron i.
186
+ "ジイサン" -> "jiisan"
187
+ "びいどろ" -> "biidoro"
188
+ "ものいい" -> "monoii"
189
+ # 2.5.5.2.1 morphemic final u verbs (unmerged).
190
+ "ぬう" -> "nuu"
191
+ "とう" -> "tou"
192
+ "おもう" -> "omou"
193
+ # 2.5.5.1 morpheme-boundary examples (unmerged; the 本居 example is
194
+ # kanji-level - Moto+ori - and the contracted kana もとい reads
195
+ # motoi kana-by-kana, so only the kana-expressible cases are tested).
196
+ "こうし" -> "koushi"
197
+ "ながあめ" -> "nagaame"
198
+ "かいしゃあん" -> "kaishaan"
199
+ "くされえん" -> "kusareen"
200
+ # 5.2 n-apostrophe examples.
201
+ "しんえつ" -> "shin'etsu"
202
+ "ほんやく" -> "hon'yaku"
203
+ "しんあいなる" -> "shin'ainaru"
204
+ "さんおくえん" -> "san'okuen"
205
+ "しんうち" -> "shin'uchi"
206
+ # Chart A note ii sokuon examples.
207
+ "あっぱく" -> "appaku"
208
+ "がっかい" -> "gakkai"
209
+ "とっしん" -> "tosshin"
210
+ "みっちゃく" -> "mitchaku"
211
+ }
212
+
213
+ stage main {
214
+
215
+ # RULES
216
+ # 4.4.1: the repetition markers ゝ and ゞ indicate repetition of the
217
+ # previous syllable; the kana is doubled so the charts romanize it
218
+ # twice.
219
+ sub {
220
+ from capture(any("あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをんがぎぐげござじずぜぞだぢづでどばびぶべぼぱぴぷぺぽアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲンガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ")) + any("ゝゞ")
221
+ to ref( 1 ) + ref( 1 )
222
+ }
223
+
224
+ # 5.2: transcribe the apostrophe between syllables when the first
225
+ # syllable ends with n and the following syllable begins with a
226
+ # vowel (a, i, u, e, o) or y.
227
+ sub {
228
+ from capture(any("んン"))
229
+ to ref( 1 ) + "'"
230
+ after any("あいうえおやゆよゐゑアイウエオヤユヨヰヱ")
231
+ }
232
+
233
+ # CHARACTERS
234
+ parallel {
235
+
236
+ # Chart A - Standard Chart
237
+
238
+ # Hiragana gojūon
239
+ sub "あ" "a"
240
+ sub "い" "i"
241
+ sub "う" "u"
242
+ sub "え" "e"
243
+ sub "お" "o"
244
+ sub "か" "ka"
245
+ sub "き" "ki"
246
+ sub "く" "ku"
247
+ sub "け" "ke"
248
+ sub "こ" "ko"
249
+ sub "さ" "sa"
250
+ sub "し" "shi" # footnote 1: si (Kunrei, Nippon)
251
+ sub "す" "su"
252
+ sub "せ" "se"
253
+ sub "そ" "so"
254
+ sub "た" "ta"
255
+ sub "ち" "chi" # footnote 2: ti, tu (Kunrei, Nippon)
256
+ sub "つ" "tsu" # footnote 2
257
+ sub "て" "te"
258
+ sub "と" "to"
259
+ sub "な" "na"
260
+ sub "に" "ni"
261
+ sub "ぬ" "nu"
262
+ sub "ね" "ne"
263
+ sub "の" "no"
264
+ sub "は" "ha" # chart note i: wa as particle (not encoded, see notes)
265
+ sub "ひ" "hi"
266
+ sub "ふ" "fu" # footnote 3: hu (Kunrei, Nippon)
267
+ sub "へ" "he" # chart note i: e as particle (not encoded, see notes)
268
+ sub "ほ" "ho"
269
+ sub "ま" "ma"
270
+ sub "み" "mi"
271
+ sub "む" "mu"
272
+ sub "め" "me"
273
+ sub "も" "mo"
274
+ sub "や" "ya"
275
+ sub "ゆ" "yu"
276
+ sub "よ" "yo"
277
+ sub "ら" "ra"
278
+ sub "り" "ri"
279
+ sub "る" "ru"
280
+ sub "れ" "re"
281
+ sub "ろ" "ro"
282
+ sub "わ" "wa"
283
+ sub "ゐ" "i"
284
+ sub "ゑ" "e"
285
+ sub "を" "o" # footnote 4: always o regardless of usage
286
+ sub "ん" "n" # footnote 5: always n, never m
287
+
288
+ # Hiragana dakuten/handakuten
289
+ sub "が" "ga"
290
+ sub "ぎ" "gi"
291
+ sub "ぐ" "gu"
292
+ sub "げ" "ge"
293
+ sub "ご" "go"
294
+ sub "ざ" "za"
295
+ sub "じ" "ji" # footnote 6: zi (Kunrei, Nippon)
296
+ sub "ず" "zu"
297
+ sub "ぜ" "ze"
298
+ sub "ぞ" "zo"
299
+ sub "だ" "da"
300
+ sub "ぢ" "ji" # footnote 7: zi, zu (Kunrei); di, du (Nippon)
301
+ sub "づ" "zu" # footnote 7
302
+ sub "で" "de"
303
+ sub "ど" "do"
304
+ sub "ば" "ba"
305
+ sub "び" "bi"
306
+ sub "ぶ" "bu"
307
+ sub "べ" "be"
308
+ sub "ぼ" "bo"
309
+ sub "ぱ" "pa"
310
+ sub "ぴ" "pi"
311
+ sub "ぷ" "pu"
312
+ sub "ぺ" "pe"
313
+ sub "ぽ" "po"
314
+
315
+ # Katakana gojūon
316
+ sub "ア" "a"
317
+ sub "イ" "i"
318
+ sub "ウ" "u"
319
+ sub "エ" "e"
320
+ sub "オ" "o"
321
+ sub "カ" "ka"
322
+ sub "キ" "ki"
323
+ sub "ク" "ku"
324
+ sub "ケ" "ke"
325
+ sub "コ" "ko"
326
+ sub "サ" "sa"
327
+ sub "シ" "shi" # footnote 1
328
+ sub "ス" "su"
329
+ sub "セ" "se"
330
+ sub "ソ" "so"
331
+ sub "タ" "ta"
332
+ sub "チ" "chi" # footnote 2
333
+ sub "ツ" "tsu" # footnote 2
334
+ sub "テ" "te"
335
+ sub "ト" "to"
336
+ sub "ナ" "na"
337
+ sub "ニ" "ni"
338
+ sub "ヌ" "nu"
339
+ sub "ネ" "ne"
340
+ sub "ノ" "no"
341
+ sub "ハ" "ha" # chart note i
342
+ sub "ヒ" "hi"
343
+ sub "フ" "fu" # footnote 3
344
+ sub "ヘ" "he" # chart note i
345
+ sub "ホ" "ho"
346
+ sub "マ" "ma"
347
+ sub "ミ" "mi"
348
+ sub "ム" "mu"
349
+ sub "メ" "me"
350
+ sub "モ" "mo"
351
+ sub "ヤ" "ya"
352
+ sub "ユ" "yu"
353
+ sub "ヨ" "yo"
354
+ sub "ラ" "ra"
355
+ sub "リ" "ri"
356
+ sub "ル" "ru"
357
+ sub "レ" "re"
358
+ sub "ロ" "ro"
359
+ sub "ワ" "wa"
360
+ sub "ヰ" "i"
361
+ sub "ヱ" "e"
362
+ sub "ヲ" "o" # footnote 4
363
+ sub "ン" "n" # footnote 5
364
+
365
+ # Katakana dakuten/handakuten
366
+ sub "ガ" "ga"
367
+ sub "ギ" "gi"
368
+ sub "グ" "gu"
369
+ sub "ゲ" "ge"
370
+ sub "ゴ" "go"
371
+ sub "ザ" "za"
372
+ sub "ジ" "ji" # footnote 6
373
+ sub "ズ" "zu"
374
+ sub "ゼ" "ze"
375
+ sub "ゾ" "zo"
376
+ sub "ダ" "da"
377
+ sub "ヂ" "ji" # footnote 7
378
+ sub "ヅ" "zu" # footnote 7
379
+ sub "デ" "de"
380
+ sub "ド" "do"
381
+ sub "バ" "ba"
382
+ sub "ビ" "bi"
383
+ sub "ブ" "bu"
384
+ sub "ベ" "be"
385
+ sub "ボ" "bo"
386
+ sub "パ" "pa"
387
+ sub "ピ" "pi"
388
+ sub "プ" "pu"
389
+ sub "ペ" "pe"
390
+ sub "ポ" "po"
391
+
392
+ # Chart A yōon (contracted sounds)
393
+ sub "きゃ" "kya"
394
+ sub "キャ" "kya"
395
+ sub "きぁ" "kya"
396
+ sub "キァ" "kya"
397
+ sub "きぃ" "kī"
398
+ sub "キィ" "kī"
399
+ sub "きゅ" "kyu"
400
+ sub "キュ" "kyu"
401
+ sub "きぇ" "kye"
402
+ sub "キェ" "kye"
403
+ sub "きょ" "kyo"
404
+ sub "キョ" "kyo"
405
+ sub "しゃ" "sha" # footnote 8: sya, syu, syo (Kunrei, Nippon)
406
+ sub "シャ" "sha" # footnote 8
407
+ sub "しゅ" "shu" # footnote 8
408
+ sub "シュ" "shu" # footnote 8
409
+ sub "しぇ" "she"
410
+ sub "シェ" "she"
411
+ sub "しょ" "sho" # footnote 8
412
+ sub "ショ" "sho" # footnote 8
413
+ sub "ちゃ" "cha" # footnote 9: tya, tyu, tyo (Kunrei, Nippon)
414
+ sub "チャ" "cha" # footnote 9
415
+ sub "ちゅ" "chu" # footnote 9
416
+ sub "チュ" "chu" # footnote 9
417
+ sub "ちぇ" "che"
418
+ sub "チェ" "che"
419
+ sub "ちょ" "cho" # footnote 9
420
+ sub "チョ" "cho" # footnote 9
421
+ sub "にゃ" "nya"
422
+ sub "ニャ" "nya"
423
+ sub "にぃ" "nī"
424
+ sub "ニィ" "nī"
425
+ sub "にゅ" "nyu"
426
+ sub "ニュ" "nyu"
427
+ sub "にぇ" "nye"
428
+ sub "ニェ" "nye"
429
+ sub "にょ" "nyo"
430
+ sub "ニョ" "nyo"
431
+ sub "ひゃ" "hya"
432
+ sub "ヒャ" "hya"
433
+ sub "ひぃ" "hī"
434
+ sub "ヒィ" "hī"
435
+ sub "ひゅ" "hyu"
436
+ sub "ヒュ" "hyu"
437
+ sub "ひぇ" "hye"
438
+ sub "ヒェ" "hye"
439
+ sub "ひょ" "hyo"
440
+ sub "ヒョ" "hyo"
441
+ sub "ひぉ" "hyo"
442
+ sub "ヒォ" "hyo"
443
+ sub "みゃ" "mya"
444
+ sub "ミャ" "mya"
445
+ sub "みぃ" "mī"
446
+ sub "ミィ" "mī"
447
+ sub "みゅ" "myu"
448
+ sub "ミュ" "myu"
449
+ sub "みぇ" "mye"
450
+ sub "ミェ" "mye"
451
+ sub "みょ" "myo"
452
+ sub "ミョ" "myo"
453
+ sub "りゃ" "rya"
454
+ sub "リャ" "rya"
455
+ sub "りぃ" "rī"
456
+ sub "リィ" "rī"
457
+ sub "りゅ" "ryu"
458
+ sub "リュ" "ryu"
459
+ sub "りぇ" "rye"
460
+ sub "リェ" "rye"
461
+ sub "りょ" "ryo"
462
+ sub "リョ" "ryo"
463
+ sub "ぎゃ" "gya"
464
+ sub "ギャ" "gya"
465
+ sub "ぎぃ" "gī"
466
+ sub "ギィ" "gī"
467
+ sub "ぎゅ" "gyu"
468
+ sub "ギュ" "gyu"
469
+ sub "ぎぇ" "gye"
470
+ sub "ギェ" "gye"
471
+ sub "ぎょ" "gyo"
472
+ sub "ギョ" "gyo"
473
+ sub "じゃ" "ja" # footnote 10: zya, zyu, zyo (Kunrei, Nippon)
474
+ sub "ジャ" "ja" # footnote 10
475
+ sub "じゅ" "ju" # footnote 10
476
+ sub "ジュ" "ju" # footnote 10
477
+ sub "じぇ" "je"
478
+ sub "ジェ" "je"
479
+ sub "じょ" "jo" # footnote 10
480
+ sub "ジョ" "jo" # footnote 10
481
+ sub "ぢゃ" "ja" # footnote 11: zya, zyu, zyo (Kunrei); dya, dyu, dyo (Nippon)
482
+ sub "ヂャ" "ja" # footnote 11
483
+ sub "ぢゅ" "ju" # footnote 11
484
+ sub "ヂュ" "ju" # footnote 11
485
+ sub "ぢぇ" "je"
486
+ sub "ヂェ" "je"
487
+ sub "ぢょ" "jo" # footnote 11
488
+ sub "ヂョ" "jo" # footnote 11
489
+ sub "びゃ" "bya"
490
+ sub "ビャ" "bya"
491
+ sub "びぃ" "bī"
492
+ sub "ビィ" "bī"
493
+ sub "びゅ" "byu"
494
+ sub "ビュ" "byu"
495
+ sub "びぇ" "bye"
496
+ sub "ビェ" "bye"
497
+ sub "びょ" "byo"
498
+ sub "ビョ" "byo"
499
+ sub "びぉ" "byo"
500
+ sub "ビォ" "byo"
501
+ sub "ぴゃ" "pya"
502
+ sub "ピャ" "pya"
503
+ sub "ぴぃ" "pī"
504
+ sub "ピィ" "pī"
505
+ sub "ぴゅ" "pyu"
506
+ sub "ピュ" "pyu"
507
+ sub "ぴぇ" "pye"
508
+ sub "ピェ" "pye"
509
+ sub "ぴょ" "pyo"
510
+ sub "ピョ" "pyo"
511
+ sub "ぴぉ" "pyo"
512
+ sub "ピォ" "pyo"
513
+
514
+ # Chart B - Non-traditional Japanese Chart (Foreign Words, etc.)
515
+ sub "いぇ" "ye"
516
+ sub "イェ" "ye"
517
+ sub "うぁ" "wa"
518
+ sub "ウァ" "wa"
519
+ sub "うぃ" "wi"
520
+ sub "ウィ" "wi"
521
+ sub "うぇ" "we"
522
+ sub "ウェ" "we"
523
+ sub "うぉ" "wo"
524
+ sub "ウォ" "wo"
525
+ sub "くぁ" "kwa"
526
+ sub "クァ" "kwa"
527
+ sub "くぃ" "kwi"
528
+ sub "クィ" "kwi"
529
+ sub "くぇ" "kwe"
530
+ sub "クェ" "kwe"
531
+ sub "くぉ" "kwo"
532
+ sub "クォ" "kwo"
533
+ sub "すぃ" "si"
534
+ sub "スィ" "si"
535
+ sub "すぇ" "swe"
536
+ sub "スェ" "swe"
537
+ sub "ぐぁ" "gwa"
538
+ sub "グァ" "gwa"
539
+ sub "ぐぃ" "gwi"
540
+ sub "グィ" "gwi"
541
+ sub "ぐぇ" "gwe"
542
+ sub "グェ" "gwe"
543
+ sub "ぐぉ" "gwo"
544
+ sub "グォ" "gwo"
545
+ sub "ずぃ" "zi"
546
+ sub "ズィ" "zi"
547
+ sub "つぁ" "tsa"
548
+ sub "ツァ" "tsa"
549
+ sub "つぃ" "tsi"
550
+ sub "ツィ" "tsi"
551
+ sub "つぇ" "tse"
552
+ sub "ツェ" "tse"
553
+ sub "つぉ" "tso"
554
+ sub "ツォ" "tso"
555
+ sub "てぃ" "ti"
556
+ sub "ティ" "ti"
557
+ sub "とぅ" "tu"
558
+ sub "トゥ" "tu"
559
+ sub "てゅ" "tyu"
560
+ sub "テュ" "tyu"
561
+ sub "ふぁ" "fa"
562
+ sub "ファ" "fa"
563
+ sub "ふぃ" "fi"
564
+ sub "フィ" "fi"
565
+ sub "ふゅ" "fyu"
566
+ sub "フュ" "fyu"
567
+ sub "ふぇ" "fe"
568
+ sub "フェ" "fe"
569
+ sub "ふぉ" "fo"
570
+ sub "フォ" "fo"
571
+ sub "ふぃぇ" "fye"
572
+ sub "フィェ" "fye"
573
+ sub "ふょ" "fyo"
574
+ sub "フョ" "fyo"
575
+ sub "ヴァ" "va"
576
+ sub "ヴィ" "vi"
577
+ sub "ヴ" "vu"
578
+ sub "ヴェ" "ve"
579
+ sub "ヴォ" "vo"
580
+ sub "ヴュ" "vyu"
581
+ sub "でぃ" "di"
582
+ sub "ディ" "di"
583
+ sub "どぅ" "du"
584
+ sub "ドゥ" "du"
585
+ sub "でゅ" "dyu"
586
+ sub "デュ" "dyu"
587
+
588
+ # Chart B note iii: sequences not found in the tables romanize as
589
+ # if the added small characters were regular characters
590
+ # (e.g. アィ ai, スェ sue, ヴィァ via).
591
+ sub "ぁ" "a"
592
+ sub "ぃ" "i"
593
+ sub "ぅ" "u"
594
+ sub "ぇ" "e"
595
+ sub "ぉ" "o"
596
+ sub "ァ" "a"
597
+ sub "ィ" "i"
598
+ sub "ゥ" "u"
599
+ sub "ェ" "e"
600
+ sub "ォ" "o"
601
+
602
+ # 4.2 punctuation and typographical marks with roman equivalents
603
+ sub "、" ","
604
+ sub "。" "."
605
+ sub "?" "?"
606
+ sub "!" "!"
607
+ sub "〜" "-" # tilde: hyphen between dates, from ... to ...
608
+ # 4.2 quotation mark types 1 and 2
609
+ sub "「" "\""
610
+ sub "」" "\""
611
+ sub "『" "\""
612
+ sub "』" "\""
613
+ # 4.3 brackets and parentheses
614
+ sub "〈" "<"
615
+ sub "〉" ">"
616
+ sub "《" "<" # double angle brackets
617
+ sub "》" ">"
618
+ sub "〔" "["
619
+ sub "〕" "]"
620
+ sub "〘" "["
621
+ sub "〙" "]"
622
+ sub "〚" "["
623
+ sub "〛" "]"
624
+ sub "(" "("
625
+ sub ")" ")"
626
+ }
627
+
628
+ # POSTRULES
629
+ # Chart A note ii: double consonants (促音) are represented by a
630
+ # doubling of the corresponding consonant (e.g. 圧迫 appaku, 学会
631
+ # gakkai, 突進 tosshin); if a double consonant occurs with ch-, add
632
+ # t instead of doubling c (e.g. 密着 mitchaku, 熱中 netchū, 出張
633
+ # shutchō).
634
+ sub {
635
+ from any("っッ") + capture(any("BbDdFfGgHhJjKkLlMmNnPpQqRrSsTtVvWwXxYyZz"))
636
+ to ref( 1 ) + ref( 1 )
637
+ }
638
+ sub {
639
+ from any("っッ") + capture(any("Cc"))
640
+ to "t" + ref( 1 )
641
+ }
642
+ # A sokuon not followed by a consonant has no romanization in the
643
+ # document; it is realized as an abrupt stop and is dropped here.
644
+ sub {
645
+ from any("っッ")
646
+ to ""
647
+ }
648
+
649
+ # 2.5.1: vowels written with a lengthening bar are romanized with a
650
+ # macron (e.g. コンピュータ konpyūta, ニューヨーク Nyū Yōku, そーっと
651
+ # sōtto); 2.5.4: long i after the bar is the macron ī.
652
+ sub {
653
+ from "a" + "ー"
654
+ to "ā"
655
+ }
656
+ sub {
657
+ from "i" + "ー"
658
+ to "ī"
659
+ }
660
+ sub {
661
+ from "u" + "ー"
662
+ to "ū"
663
+ }
664
+ sub {
665
+ from "e" + "ー"
666
+ to "ē"
667
+ }
668
+ sub {
669
+ from "o" + "ー"
670
+ to "ō"
671
+ }
672
+ }
673
+ }