Skip to content
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

putonghua.js adds derivation of voiceless checked tones 清音入聲, fine-tunes derivation of chong 崇母, chang 常母, and chuan initials 船母 | putonghua.js 补充清音入聲的推導,微調崇常船三母的推導 #55

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 62 additions & 3 deletions putonghua.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
/* 推導普通話
*
* @author graphemecluster
*
* 選項「清聲母入聲調分派層次」詳見平山久雄《中古汉语的清入声在北京话里的对应规律》
* http://ccj.pku.edu.cn/Article/DownLoad?id=271015083&&type=ArticleFile
* 默認選擇為「皆派入陰平」,参考刘海阳在對「北京话的入声为什么会派入三个不同的声调?」的回答中披露的材料——
* 「古代清音入声字在北京話的声調,凡是沒有异讀的,就采用北京已經通行的讀法。凡是有异讀的,假若其中有一个是陰平調,原則上就采用陰平,例如:“息”ㄒㄧ(xī)“击”ㄐㄧ(jī)。否則逐字考慮,采用比較通行……」
* https://www.zhihu.com/question/30370012/answer/533234460
*
* 選項「常母平聲陰聲韻聲母和船母平聲聲母」詳見 unt 對「为何中古的dʑ ʑ和普通话读音的对应似乎是反的(即dʑ > ʂ、ʑ > ʈʂ)?」的回答
* https://www.zhihu.com/question/526195183/answer/2425807330
*/

/** @type { 音韻地位['屬於'] } */
const is = (...x) => 音韻地位.屬於(...x);
/** @type { 音韻地位['判斷'] } */
const when = (...x) => 音韻地位.判斷(...x);

const is更多選項 = 選項.更多選項 ?? false;

if (!音韻地位) return [
['標調方式', [2, '數字', '附標']],

['更多選項', is更多選項],
...(is更多選項 ? [
'更多選項',
['清聲母入聲調分派層次',
[ 2,
'皆派入上聲',
'皆派入陰平',
'次清、擦音和零聲母字派入去聲,其餘派入陽平',
'次清和零聲母字派入去聲,其餘派入陽平',
'連同濁聲母、所有入聲字皆派入去聲'
]
],
['常母平聲陰聲韻聲母和船母平聲聲母', [2, 'ch', 'sh']],
// '', // 在 v0.1 推導器中使「恢復預設值」按鈕位於下一行
] : []),
];

const 聲母規則 = () => when([
Expand Down Expand Up @@ -38,13 +65,13 @@ const 聲母規則 = () => when([

['莊母', 'zh'],
['初母', 'ch'],
['崇母', [['平聲', 'ch'], ['', 'sh']]],
['崇母', [['平聲', 'ch'], ['', 'zh']]],
['生母', 'sh'],
['俟母', 'sh'],

['章母', 'zh'],
['昌母', 'ch'],
['常母', [['平聲', 'ch'], ['', 'sh']]],
['常母', [['平聲 陽聲韻', 'ch'], ['', 'sh']]],
['書母', 'sh'],
['船母', 'sh'],
['日母', 'r'],
Expand Down Expand Up @@ -177,7 +204,7 @@ const 聲調規則 = () => when([
['平聲', '1'],
['上聲', '3'],
['去聲', '4'],
['入聲', ''],
['入聲', '1'],
]],
['濁音', [
['平聲', '2'],
Expand All @@ -191,6 +218,38 @@ let 聲母 = 聲母規則();
let 韻母 = is`舒聲` ? 舒聲韻母規則() : 入聲韻母規則();
graphemecluster marked this conversation as resolved.
Show resolved Hide resolved
let 聲調 = 聲調規則();

if (選項.更多選項) {
// 參考 https://www.zhihu.com/question/526195183/answer/2425807330
if (is`(常母 陰聲韻 或 船母) 平聲`) 聲母 = 選項.常母平聲陰聲韻聲母和船母平聲聲母;

/* 參考
* http://ccj.pku.edu.cn/Article/DownLoad?id=271015083&&type=ArticleFile (https://web.archive.org/web/20240223084634/http://ccj.pku.edu.cn/Article/DownLoad?id=271015083&&type=ArticleFile)
* https://www.zhihu.com/question/30370012/answer/533234460
* https://www.zhihu.com/question/30370012/answer/535713330
*/
if (is`入聲`) {
switch (選項.清聲母入聲調分派層次) {
case '皆派入上聲':
if (is`清音`) 聲調 = '3';
break;
case '皆派入陰平':
if (is`清音`) 聲調 = '1';
break;
case '次清、擦音和零聲母字派入去聲,其餘派入陽平':
if (is`心生書影曉母 或 次清`) 聲調 = '4';
else if (is`全清`) 聲調 = '2';
break;
case '次清和零聲母字派入去聲,其餘派入陽平':
if (is`影母 或 次清`) 聲調 = '4';
else if (is`全清`) 聲調 = '2';
break;
case '連同濁聲母、所有入聲字皆派入去聲':
聲調 = '4';
break;
}
}
}

if (['i', 'ü'].includes(韻母[0])) 聲母 = {
g: 'j', k: 'q', h: 'x',
z: 'j', c: 'q', s: 'x',
Expand Down
Loading