/
IPAToEnglishApproximation.php
59 lines (56 loc) · 2.06 KB
/
IPAToEnglishApproximation.php
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
<?php
declare(strict_types=1);
namespace PrinsFrank\Transliteration\ConversionSet;
use PrinsFrank\Transliteration\ConversionSet;
use PrinsFrank\Transliteration\Exception\RecursionException;
use PrinsFrank\Transliteration\TransliteratorBuilder;
/** @api */
final class IPAToEnglishApproximation implements ConversionSet
{
/** @throws RecursionException */
public function apply(TransliteratorBuilder $transliteratorBuilder): void
{
$transliteratorBuilder->applyConversionSets(
[
new Replace('dʒ', 'g'),
new Replace('kʰ', 'c'),
new Replace('kʷ', 'qu'),
new Replace('kᶣ', 'cu'),
new Replace('ɫ', 'll'),
new Replace('ŋ', 'n'),
new Replace('Ŋ', 'N'),
new Replace('ɲ', 'n'),
new Replace('Ɲ', 'N'),
new Replace('pʰ', 'p'),
new Replace('ʃ', 'sh'),
new Replace('Ʃ', 'SH'),
new Replace('tʰ', 't'),
new Replace('tʃ', 'ch'),
new Replace('aː', 'a'),
new Replace('Aː', 'A'),
new Replace('ɛ', 'e'),
new Replace('Ɛ', 'E'),
new Replace('eː', 'a'),
new Replace('Eː', 'A'),
new Replace('ɪ', 'i'),
new Replace('Ɪ', 'I'),
new Replace('iː', 'i'),
new Replace('Iː', 'I'),
new Replace('ɔ', 'o'),
new Replace('Ɔ', 'O'),
new Replace('oː', 'aw'),
new Replace('ʊ', 'u'),
new Replace('Ʊ', 'U'),
new Replace('ʌ', 'u'),
new Replace('Ʌ', 'U'),
new Replace('uː', 'u'),
new Replace('yː', 'u'),
new Replace('ae̯', 'igh'),
new Replace('oe̯', 'oy'),
new Replace('au̯', 'ow'),
new Replace('ei̯', 'ay'),
new Replace('ui̯', 'ui'),
]
);
}
}