-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
老國音 #60
base: main
Are you sure you want to change the base?
老國音 #60
Changes from 1 commit
d24a3fd
795af1e
85fd26f
a8af6cc
17a4ac6
90ea890
14775c7
08d7b21
7fd735d
83b4b97
ff53d16
1af9075
95f5bfa
435bba5
51ec6ce
68bb61b
6cebc27
0e5eafe
d564db9
9d9a189
6f820a0
d8a4f88
3a1f6b5
bd5cb90
0461471
43eeef0
d5edac5
bad7031
c317f01
805c828
f16c762
9813ac3
5128326
a51de91
193e906
2ae7514
3192e32
07050b8
f900ebe
f35bdb2
a6abd3f
ba5696d
bafd589
8159b4b
bcced32
8ef0f9e
c4e3562
a2c90c0
edcc2b5
9a8c846
31aa9da
be665ee
2cf4143
c319add
954f892
59344f1
7a24191
05a3eab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,10 +1,11 @@ | ||||||||||
/* 推導老國音,@author 307587 | ||||||||||
/* 推導老國音 | ||||||||||
|
||||||||||
音系:https://zh.wikiversity.org/zh-hant/%E8%80%81%E5%9C%8B%E9%9F%B3%E9%9F%B3%E7%B4%A0 | ||||||||||
音變規則:https://zh.wikiversity.org/zh-hant/%E8%80%81%E5%9C%8B%E9%9F%B3%E8%88%87%E5%BB%A3%E9%9F%BB%E5%B0%8D%E6%AF%94 | ||||||||||
字音來源:https://github.com/baopaau/rime-bepemefeve/blob/main/bepemefeve.dict.yaml | ||||||||||
注意「僞老國音」:https://www.bilibili.com/read/cv17377530/ | ||||||||||
*/ | ||||||||||
|
||||||||||
@author 307587 */ | ||||||||||
|
||||||||||
/** @type { 音韻地位['屬於'] } */ | ||||||||||
const is = (...x) => 音韻地位.屬於(...x); | ||||||||||
|
@@ -13,23 +14,21 @@ const when = (...x) => 音韻地位.判斷(...x); | |||||||||
|
||||||||||
if (!音韻地位) return [ | ||||||||||
['注音符號\n否的話就用國際音標', true], | ||||||||||
['ㄬㄭ|ㄬ、ㄭ音標\n啟用「注音符號」時無效', [2, 'ȵ、ɿ、ʅ', 'ɲ、ɹ̩、ɻ̍']], | ||||||||||
307587 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
['介母', [1, | ||||||||||
{ text: '元音:i u y', value: '元音' }, | ||||||||||
{ text: '半元音:j w ɥ', value: '半元音' }, | ||||||||||
], { hidden: 選項.注音符號 === true }], | ||||||||||
307587 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
['ㄚ|ㄚ元音\nㄧㄞ:寬式/iai/、嚴式[iæi]\nㄧ、ㄩ後的ㄢ:寬式/-an/、嚴式[-ɛn]', [2, '嚴式', '寬式']], | ||||||||||
307587 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
['ㄨㄣ|舌冠聲母後的ㄨㄣ讀音\n趙元任《國音新詩韻》:「ㄨㄣ」也可以一律照樣拼念作「ㄨㄜㄋ」,但是在「ㄉ,ㄊ,ㄋ,ㄌ;ㄗ,ㄘ,ㄙ」七個聲母後頭可以省去「ㄜ」音念「ㄨㄋ」', [2, 'un', 'uən']], | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
[un] vs [uən] 是对这个韵母记音处理的区别,不是为了表示不同声母后的区别,所以这个选项应当对所有声母都适用 |
||||||||||
['喉塞|標示入聲喉塞音韻尾', true, { hidden: 選項.注音符號 !== false }], | ||||||||||
['調式', ['調符', | ||||||||||
'調值(趙元任)', '調值(王璞)', '調線(趙元任)', '調線(王璞)', | ||||||||||
...(選項.注音符號 === false ? ['附標'] : []), '調號上標', '調號', '調符', | ||||||||||
]], | ||||||||||
['聲調在前\n調式爲「附標」時無效', false], | ||||||||||
['隔聲韻調 | ||||||||||
調式爲「附標」時只隔聲和韻', [3, | ||||||||||
{ text: '空格', value: ' ' }, | ||||||||||
{ text: '定位', value: '\t' }, | ||||||||||
{ text: '無', value: '' }, | ||||||||||
]], | ||||||||||
['隔聲韻調|隔聲韻調\n調式爲「附標」時只隔聲和韻', ''], //待加?留空則爲跳格:(選項.隔聲韻調 || '\t') | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 隔聲韻調的意义是?普通用户好像要不到这个功能,我建议隐藏这个选项 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 他的意思是分隔符,但的確好像沒甚麼意思 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 是爲進階用戶而設,將推導結果貼到試算表可以直接分開聲韻調統計 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 進階用戶或許可以直接修改程式碼 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 看這個 comment |
||||||||||
['常母平聲陰聲韻聲母和船母平聲聲母', [2, 'tʂʰ', 'ʂ']], | ||||||||||
307587 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
['介母', [1, | ||||||||||
{ text: '元音:i u y', value: '元音' }, | ||||||||||
{ text: '半元音:j w ɥ', value: '半元音' }, | ||||||||||
], { hidden: 選項.注音符號 === true }], | ||||||||||
['見泰合|見組泰合韻韻母\nuai、uəi兩者勢均,\n但疑泰合只有「外」且讀uai', [2, 'uai', 'uəi']], | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我覺得往後所有方案選項應該用模版字串,如:
Suggested change
現在這樣 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 徵求 @syimyuzya @untunt 的意見 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 好主意! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
艸 |
||||||||||
['見佳合|牙喉音佳合韻韻母\n預測uai,但有不少ua', [2, 'ua', 'uai']], | ||||||||||
['幫幽|幫滂並母幽韻韻母\n多讀iəu,只在幫滂並母讀iau,如「彪」', [2, 'iau', 'iəu']], | ||||||||||
|
@@ -231,62 +230,62 @@ if (韻母 === 'un') 韻母 = 'uən'; //一次過un→uən | |||||||||
if (['p', 'pʰ', 'm', 'f'].includes(聲母) && 韻母[0] === 'u' && 韻母[1] && !['n', 'ŋ', 'ʔ'].includes(韻母[1])) 韻母 = 韻母.slice(1); | ||||||||||
if (['f', 'ʋ'].includes(聲母) && 韻母[0] === 'i') 韻母 = 韻母.slice(1) || 'əi'; | ||||||||||
|
||||||||||
//疑母 | ||||||||||
if (聲母 === 'ŋ' && 韻母[0] === 'u') 聲母 = ''; | ||||||||||
if (選項.注音符號 !== true && 韻母 === 'uən' && ['t', 'tʰ', 'n', 'l', 'ts', 'tsʰ', 's'].includes(聲母)) 韻母 = 選項.ㄨㄣ; //ㄨㄣ元音 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
同上面评论 |
||||||||||
|
||||||||||
if (聲母 === 'ŋ' && 韻母[0] === 'u') 聲母 = ''; //疑母合口 | ||||||||||
|
||||||||||
//介母 | ||||||||||
if (選項.介母 === true && 選項.注音符號 === false && !聲母) { | ||||||||||
if (韻母[0] === 'i') 聲母 = 'j'; | ||||||||||
if (韻母[0] === 'u') 聲母 = 'w'; | ||||||||||
if (韻母[0] === 'y') 聲母 = 'ɥ'; | ||||||||||
if (聲母 && 韻母[1] && !['n', 'ŋ', 'ʔ'].includes(韻母[1])) 韻母 = 韻母.slice(1); | ||||||||||
} | ||||||||||
|
||||||||||
if (選項.喉塞 === false && 選項.注音符號 === false && is`入聲`) 韻母 = 韻母.slice(0, -1); | ||||||||||
|
||||||||||
if (選項.注音符號 === true) { | ||||||||||
聲母 = { | ||||||||||
p: 'ㄅ', pʰ: 'ㄆ', m: 'ㄇ', f: 'ㄈ', ʋ: 'ㄪ', | ||||||||||
t: 'ㄉ', tʰ: 'ㄊ', n: 'ㄋ', l: 'ㄌ', | ||||||||||
k: 'ㄍ', kʰ: 'ㄎ', ŋ: 'ㄫ', x: 'ㄏ', | ||||||||||
tɕ: 'ㄐ', tɕʰ: 'ㄑ', ɲ: 'ㄬ', ɕ: 'ㄒ', | ||||||||||
tʂ: 'ㄓ', tʂʰ: 'ㄔ', ʂ: 'ㄕ', ɻ: 'ㄖ', | ||||||||||
ts: 'ㄗ', tsʰ: 'ㄘ', s: 'ㄙ', | ||||||||||
}[聲母] || 聲母; | ||||||||||
韻母 = { | ||||||||||
i: 'ㄧ', u: 'ㄨ', y: 'ㄩ', | ||||||||||
a: 'ㄚ', o: 'ㄛ', ə: 'ㄜ', ɚ: 'ㄦ', e: 'ㄝ', | ||||||||||
ai: 'ㄞ', əi: 'ㄟ', au: 'ㄠ', əu: 'ㄡ', | ||||||||||
an: 'ㄢ', ən: 'ㄣ', aŋ: 'ㄤ', əŋ: 'ㄥ', | ||||||||||
ia: 'ㄧㄚ', ie: 'ㄧㄝ', | ||||||||||
iai: 'ㄧㄞ', iau: 'ㄧㄠ', iəu: 'ㄧㄡ', | ||||||||||
ian: 'ㄧㄢ', in: 'ㄧㄣ', iaŋ: 'ㄧㄤ', iŋ: 'ㄧㄥ', | ||||||||||
ua: 'ㄨㄚ', uo: 'ㄨㄛ', uai: 'ㄨㄞ', uəi: 'ㄨㄟ', | ||||||||||
uan: 'ㄨㄢ', uən: 'ㄨㄣ', uaŋ: 'ㄨㄤ', uŋ: 'ㄨㄥ', | ||||||||||
yo: 'ㄩㄛ', ye: 'ㄩㄝ', yan: 'ㄩㄢ', yn: 'ㄩㄣ', yŋ: 'ㄩㄥ', | ||||||||||
iʔ: 'ㄧ', uʔ: 'ㄨ', yʔ: 'ㄩ', | ||||||||||
aʔ: 'ㄚ', iaʔ: 'ㄧㄚ', uaʔ: 'ㄨㄚ', | ||||||||||
oʔ: 'ㄛ', ioʔ: 'ㄧㄛ', uoʔ: 'ㄨㄛ', yoʔ: 'ㄩㄛ', | ||||||||||
əʔ: 'ㄜ', eʔ: 'ㄝ', ieʔ: 'ㄧㄝ', yeʔ: 'ㄩㄝ', | ||||||||||
}[韻母] || 韻母; | ||||||||||
if (['ɿ', 'ʅ'].includes(韻母[0])) 韻母 = ''; | ||||||||||
} | ||||||||||
|
||||||||||
let 隔位 = 選項.隔聲韻調; | ||||||||||
if (選項.隔聲韻調 === '無') 隔位 = ''; | ||||||||||
if (選項.隔聲韻調 === '空格') 隔位 = ' '; | ||||||||||
if (選項.隔聲韻調 === '定位') 隔位 = '\t'; | ||||||||||
if (選項.喉塞 === false && 選項.注音符號 === false && is`入聲`) 韻母 = 韻母.slice(0, -1); //喉塞音韻尾 | ||||||||||
|
||||||||||
if (選項.調式 === '附標' && 選項.注音符號 === false) { | ||||||||||
return 聲母 + 隔位 + (is`舒聲` && 聲調 ? 韻母.replace(/.*[aoəe]|.*[iɿʅuy]/, '$&' + ' ̄́̌̀'[聲調]) : 韻母); | ||||||||||
} | ||||||||||
if (選項.注音符號 === true) 聲母 = { | ||||||||||
p: 'ㄅ', pʰ: 'ㄆ', m: 'ㄇ', f: 'ㄈ', ʋ: 'ㄪ', | ||||||||||
t: 'ㄉ', tʰ: 'ㄊ', n: 'ㄋ', l: 'ㄌ', | ||||||||||
k: 'ㄍ', kʰ: 'ㄎ', ŋ: 'ㄫ', x: 'ㄏ', | ||||||||||
tɕ: 'ㄐ', tɕʰ: 'ㄑ', ɲ: 'ㄬ', ɕ: 'ㄒ', | ||||||||||
tʂ: 'ㄓ', tʂʰ: 'ㄔ', ʂ: 'ㄕ', ɻ: 'ㄖ', | ||||||||||
ts: 'ㄗ', tsʰ: 'ㄘ', s: 'ㄙ', | ||||||||||
}[聲母] || 聲母; | ||||||||||
if (選項.注音符號 === true) 韻母 = { | ||||||||||
i: 'ㄧ', u: 'ㄨ', y: 'ㄩ', | ||||||||||
a: 'ㄚ', o: 'ㄛ', ə: 'ㄜ', ɚ: 'ㄦ', e: 'ㄝ', | ||||||||||
ai: 'ㄞ', əi: 'ㄟ', au: 'ㄠ', əu: 'ㄡ', | ||||||||||
an: 'ㄢ', ən: 'ㄣ', aŋ: 'ㄤ', əŋ: 'ㄥ', | ||||||||||
ia: 'ㄧㄚ', ie: 'ㄧㄝ', | ||||||||||
iai: 'ㄧㄞ', iau: 'ㄧㄠ', iəu: 'ㄧㄡ', | ||||||||||
ian: 'ㄧㄢ', in: 'ㄧㄣ', iaŋ: 'ㄧㄤ', iŋ: 'ㄧㄥ', | ||||||||||
ua: 'ㄨㄚ', uo: 'ㄨㄛ', uai: 'ㄨㄞ', uəi: 'ㄨㄟ', | ||||||||||
uan: 'ㄨㄢ', uən: 'ㄨㄣ', uaŋ: 'ㄨㄤ', uŋ: 'ㄨㄥ', | ||||||||||
yo: 'ㄩㄛ', ye: 'ㄩㄝ', yan: 'ㄩㄢ', yn: 'ㄩㄣ', yŋ: 'ㄩㄥ', | ||||||||||
iʔ: 'ㄧ', uʔ: 'ㄨ', yʔ: 'ㄩ', | ||||||||||
aʔ: 'ㄚ', iaʔ: 'ㄧㄚ', uaʔ: 'ㄨㄚ', | ||||||||||
oʔ: 'ㄛ', ioʔ: 'ㄧㄛ', uoʔ: 'ㄨㄛ', yoʔ: 'ㄩㄛ', | ||||||||||
əʔ: 'ㄜ', eʔ: 'ㄝ', ieʔ: 'ㄧㄝ', yeʔ: 'ㄩㄝ', | ||||||||||
}[韻母] || 韻母; | ||||||||||
if (選項.注音符號 === true && ['ɿ', 'ʅ'].includes(韻母[0])) 韻母 = ''; | ||||||||||
|
||||||||||
//let 隔位 = 選項.隔聲韻調; | ||||||||||
//if (選項.隔聲韻調 === '無') 隔位 = ''; | ||||||||||
//if (選項.隔聲韻調 === '空格') 隔位 = ' '; | ||||||||||
//if (選項.隔聲韻調 === '定位') 隔位 = '\t'; | ||||||||||
|
||||||||||
聲調 = { | ||||||||||
'調值(趙元任)': { 1: '⁵⁵', 2: '³⁵', 3: '²¹⁴', 4: '⁵¹', 5: '⁵' }, | ||||||||||
'調值(王璞)': { 1: '⁴⁴', 2: '³⁵⁵', 3: '²¹⁴', 4: '⁴¹', 5: '⁴¹' }, | ||||||||||
'調線(趙元任)': { 1: '˥', 2: '˧˥', 3: '˨˩˦', 4: '˥˩', 5: '˥' }, | ||||||||||
'調線(趙元任)': { 1: '˥', 2: '˧˥', 3: '˨˩˦', 4: '˥˩', 5: '˥' }, //字元數眞對稱w | ||||||||||
'調線(王璞)': { 1: '˦', 2: '˧˥˥', 3: '˨˩˦', 4: '˦˩', 5: '˦˩' }, | ||||||||||
'調符': { 1: 'ˉ', 2: 'ˊ', 3: 'ˇ', 4: 'ˋ', 5: '˙' }, | ||||||||||
'調號上標': { 1: '¹', 2: '²', 3: '³', 4: '⁴', 5: '⁵' }, | ||||||||||
}[選項.調式]?.[聲調] || 聲調; | ||||||||||
|
||||||||||
return 選項.聲調在前 === true ? 聲調 + 隔位 + 聲母 + 隔位 + 韻母 : 聲母 + 隔位 + 韻母 + 隔位 + 聲調; | ||||||||||
if (選項.調式 !== '附標') { | ||||||||||
if (選項.聲調在前 === true) return 聲調 + 選項.隔聲韻調 + 聲母 + 選項.隔聲韻調 + 韻母; | ||||||||||
else return 聲母 + 選項.隔聲韻調 + 韻母 + 選項.隔聲韻調 + 聲調; | ||||||||||
} | ||||||||||
if (選項.調式 === '附標' && is`入聲`) return 聲母 + 選項.隔聲韻調 + 韻母; | ||||||||||
return 聲母 + 選項.隔聲韻調 + (聲調 ? 韻母.replace(/.*[aoəe]|.*[iɿʅuy]/, '$&' + ' ̄́̌̀'[聲調]) : 韻母); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
隔聲韻調的選項這樣改會令推導器標示方括號有問題;
let 隔位
那些也可以廢了吧