-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.ts
161 lines (152 loc) · 4.52 KB
/
test.ts
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
import makeTalk from '~/make/talk/index.js'
import makeTalkToIpa from '~/make/talk/ipa.js'
import makeIpaToTalk from '~/make/ipa/talk.js'
import makeIpaToXSampa from '~/make/ipa/xsampa.js'
import parseProsody from '~/make/talk/prosody.js'
import simplifyPhonetics from './make/talk/simplify'
// talk('txando^', 'txandȯ')
// talk('surdjyo^', 'suṙdjyȯ')
// talk('HEth~Ah', 'ḥẹtɦạh')
// talk('siqk', 'siṅk')
// talk('txya@+a-a++u', 'txyá̖àa̋u')
// talk('hwpo$kUi^mUno$s', 'hwpo̤kụïmụno̤s')
// talk('sinho^rEsi', 'sinhȯṙẹsi')
// talk("batO_'aH", 'batọ̄qaḥ')
// talk('aiyuQaK', 'aiyuq̇aḳ')
// talk("s'oQya&te", 'sqoq̇ya̰te')
// talk('t!arEba', 't̖aṙẹba')
// talk('txhaK!EnEba', 'txhaḳ̖ẹnẹba')
// talk('txh~im', 'txɦim')
// talk('txy~h~im', 'txẏɦim')
// talk('mh!im', 'mħim')
// talk('nh!iqh!lh!', 'nħiṅħlħ')
// talk('p*at.', 'p̂aṯ')
// talk('t*et.', 't̬eṯ')
// talk('nulQ~tQ~', 'nul̰t̰')
// talk('b?ad?', 'b̗ad̗')
// talk('p*od*h~U&u$t*ak*el*', 'p̂od̬ɦụ̰rt̬ak̬el̬')
// talk('na/\\q', 'nâṅ')
// talk('na\\\\q', 'ną̏ṅ')
// // talk('diəm˧˩˨')
// // talk('cɤ̆n˧˧')
// // talk('ɲɤ˨˦')
// // talk('uj˧˩˨')
// // talk('è.ɣì.ɣɔ̀')
// // talk('àá.fá')
// // talk('àà.k͡pɔ̃̀') // ?
// // talk('àá.ɾĩ́')
// // talk('āá.sì.kí')
// // talk('áásìkiriìmù')
// // talk('āá.ʃáà.ī.tà')
// // talk('àà.wɛ̀')
// // talk('àà.jò')
// // talk('ʊ̄.mɔ̃̄.lɛ̀')
// // talk('jà.ú.jà.úù')
// // talk('ka̠ɡa̠sʰʌ̹ŋd͡ʑa̠')
// // talk('ˈka̠ːɡa̠ɦa̠da̠')
// // talk('ka̠ɡa̠βo̞βo̞')
// // talk('săw˧˩˨')
// // talk('sɤ̆p˨ˀ˩')
// // talk('ʔɗəwk͡p̚˧˨ʔ')
// // talk('ɑb̥eˈd̥isə')
// // talk('t͡ɕɘ(ː)ŋo̞')
// // talk('t͡ɕʌ̹t̚k͈a̠ɾa̠k̚t͡ɕ͈iɭ')
// // talk('t͡ɕʌ̹pɕ͈i')
// // talk('ˈt͡ɕɘ(ː)mpʰo̞')
// // talk('t͡ɕʌ̹ŋɕʰinɰiɦa̠k̚')
// // talk('t͡ɕʌ̹ŋsʰa̠ŋβwe̞da̠m')
// // talk('ip̚p͈ʌ̹p̚t͡ɕ͈a̠')
// // talk('(ʔ)evoˈlut͡sja')
// // talk('adʁiˈχal')
// ipaToTalk(
// 'k͈o̞ms͈o̞mo̞ɭsʰɯkxɯ-na̠-a̠muɾe̞',
// 'k@oms@omoLsh~OkHO=-na_u&=-a_u&mure',
// )
// ipaToTalk('ɸʷo̞', 'Fw~o')
// ipaToTalk('kxɯnsʰo̞ɾit͡ɕʰida̠', 'kHOnsh~oritxy~h~ida_u&')
// ipaToTalk('kxɯʎʎikʰa̠da̠', 'kHOly~ly~ikh~a_u&da_u&')
// ipaToTalk('ɔ̂ːi̯.on', 'o$_i@on')
// ipaToTalk('kuɾl', 'kurl')
parse('ayu$ve^ydU')
parse('kUba^llU')
parse('fOla^sOfi')
parse('fOla^sOfirmja')
parse("'lKadami")
parse("'ldjaryu")
parse("'lttazalludju")
parse("'l'alw'hh~i")
parse('sUfI^stUkeItEdanjdxwa')
parse('AmplIfaydrai')
parse('briqketzwaqlOmptzwa')
// parse('AmplIfaydz')
parse('A&_^mplIfaydzoltxahasntayCwa')
parse("'lddarr'dj'ti")
parse("'lK'Qida_ti")
parse("'lGu_lfu")
parse("galf'u")
parse("galf'u'")
parse("galf'u'l")
parse('gaialfsz')
parse('gaiaoilfst')
parse('greIdAotxs')
parse('prvst')
parse("'uHtQ~ubu_tQ~")
parse(['ka', 'hru_', 'dQ~a', "w'", 'i', 'yy'].join(''))
parse(['ka', 'hru_', 'manz', 'i', 'li', 'yy'].join(''))
parse(['la', 'djd', 'ja'].join(''))
parse(['ko_ns', 'arv', 'a_', 'tu', 'wa_r'].join(''))
parse(['marc', 'i', 'ya'].join(''))
parse(['ma', 'sQ~', 'sQ~a_sQ~'].join(''))
parse(['mu', 'dj', 'rim'].join(''))
parse(['ma', 'Hh~al', 'li', 'yy'].join(''))
parse('kIt~a_^b')
parse(['Ku', 'sQ~', 'ru', 'mill'].join(''))
parse(['Ka', 'sQ~', 'riy', 'ya'].join(''))
parse(['KantQ~', 'u_r'].join(''))
parse(['Qidj', 'rim'].join(''))
parse(['ma', 'wrid'].join(''))
parse("'lssamaka_tu 'lbuhh~ayri_a_tu")
parse(`'lliK'hh~u`)
parse(`'lQi_'da_tu`)
// console.log('hello', makeTalk.machine('hello'))
// console.log(
// 'greIdAotxs',
// simplifyPhonetics('greIdAotxs').map(
// view => `${view.text} (${view.mass}) = ${view.code}`,
// ),
// )
// console.log(simplifyPhonetics(`Kad~Q~a_^'`))
parse('u$U^nIq')
parse('bu$U^nIq')
parse('bou$U^nIq')
parse('sa^kOu$')
parse('xakiu$U')
parse('ske^ytbou$dIq')
function parse(word: string) {
console.log(word)
console.log(' ', parseProsody(word).join(' - '))
// console.log(
// makeTalkToIpa(word),
// parseProsody(word).map(makeTalkToIpa).join('-'),
// )
}
function talk(a: string, b: string) {
const o = makeTalk(a)
// console.log(o)
o.split('').forEach((x, i) => {
if (x !== b[i]) {
throw new Error(`${o} with ${x} != ${b[i]}`)
}
})
}
function ipaToTalk(a: string, b: string) {
const o = makeIpaToTalk(a)
const x = makeIpaToXSampa(a)
// console.log(o, x)
console.log(a, x)
o.split('').forEach((x, i) => {
if (x !== b[i]) {
throw new Error(`${o} with ${x} != ${b[i]}`)
}
})
}