Skip to content

Commit

Permalink
Update unt: 灰魂 oj, on → wəj, wən; 豪覃 ʌw, ʌm → əw, əm
Browse files Browse the repository at this point in the history
  • Loading branch information
untunt committed Jul 13, 2024
1 parent a535894 commit 5c6de54
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions unt.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const when = (...x) => 音韻地位.判斷(...x);

const is專業模式 = 選項.專業模式 ?? false;
const isL = 選項.版本?.includes('L') ?? true;
const isJ新版 = Boolean(選項.版本?.includes('J') && 選項.版本?.includes('新版'));
const isJ原版 = Boolean(選項.版本?.includes('J') && 選項.版本?.includes('原版'));
const isJ2024 = Boolean(選項.版本?.includes('J') && 選項.版本?.includes('2024'));
const isJ原版 = Boolean(選項.版本?.includes('J') && 選項.版本?.includes('原版')); // 2020
const isJ新版 = Boolean(選項.版本?.includes('J') && !選項.版本?.includes('原版')); // 2022 或 2024
const isJ2024 = Boolean(選項.版本?.includes('J') && !選項.版本?.includes('')); // 2024
const is朗讀音 = Boolean(選項.版本?.includes('朗讀音'));
const is通俗 = Boolean(選項.版本?.includes('通俗'));

Expand All @@ -39,8 +39,8 @@ function get選項列表() {
['版本', [is專業模式 ? 5 : 2,
'2019:切韻朗讀音',
'2020:切韻擬音 J(原版)',
'2020:切韻擬音 J(2022 新版)',
'2020:切韻擬音 J(2024 新版)',
'2020:切韻擬音 J(2022 )',
'2020:切韻擬音 J', // 2024 版
'2022:切韻擬音 L',
'2023:切韻通俗擬音',
].filter((_, i) => is專業模式 || ![1, 2, 3].includes(i))],
Expand All @@ -56,7 +56,7 @@ function get選項列表() {
'五度符號',
'五度符號(帶拖腔)',
'無',
].filter((_, i) => (is專業模式 || [0, 1, 3, 4, 6].includes(i)) && !(is朗讀音 && i === 4))],
].filter((_, i) => (is專業模式 || [0, 1, 2, 4, 6].includes(i)) && !(is朗讀音 && i === 4))],
['鈍 C 介音',
isL && [1, '開∅ 合w'] ||
// ɣ 代表軟腭近音(即 ɣ̞)
Expand All @@ -72,21 +72,23 @@ function get選項列表() {
'i ie ə o',
'i e ə o',
] : null],
['泰祭夬廢韻尾', isJ新版 || isL || is通俗 ? null : !is朗讀音 ? [1, 'j', 'ɹ'] : [1, 'jɕ']],
['j 韻尾去聲作 ɹ', isJ新版 || isL ? false : null], // 脂韻去聲則後加 ɹ
['豪覃', isJ2024 || isL ? [1, 'əw əm', 'ʌw ʌm'] : null],
['見組非三等簡寫作軟腭音', isJ2024 ? false : null],
['見組非三等簡寫作軟腭音 ', is通俗 ? true : null],
].concat(is專業模式 && !is通俗 && !is朗讀音 ? [
].concat(is專業模式 ? [
'高級選項',
['前部聲母非三等', isL ? [1, 'ᵱ ɫ', 'pˤ lˤ', 'p̙ l̙'] : null],
['知組', isJ原版 ? [2, 'ʈ', 'tɹ'] : null],
['二等元音記號', [1,
['二等元音記號', !is朗讀音 ? [1,
'咽化 ◌ˤ',
'r音鉤(帶空隙)◌˞ ',
'r音鉤(無空隙)◌˞',
'下等號 ◌͇',
'雙下橫線 ◌̳', // 僅在下等號顯示不正常時使用
]],
] : null],
['灰魂', isJ2024 || isL ? [1, 'wəj wən', 'oj on'] : null],
['泰祭夬廢韻尾', isJ新版 || isL || is通俗 ? null : !is朗讀音 ? [1, 'j', 'ɹ'] : [1, 'jɕ']],
['j 韻尾去聲作 ɹ', isJ新版 || isL ? false : null], // 脂韻去聲則後加 ɹ
['顯示純音位形式', isL ? false : null],
'', // 在 v0.1 推導器中使「恢復預設值」按鈕位於下一行
] : []);
Expand Down Expand Up @@ -234,7 +236,7 @@ function 音位to音值(音節) {
}
if (is音節首含唇 && !is展唇鈍韻尾 && !is雙唇韻尾) {
音節.替換('韻核', 'ɨ', 'u');
if (!is`三等` || !音節.韻尾) 音節.替換('韻核', 'ə', 'o');
if ((選項.灰魂?.includes('o') || !(isJ2024 || isL)) && !is`三等` || !音節.韻尾) 音節.替換('韻核', 'ə', 'o');
} // 豪韻唇音可能也是獨立的,但爲了簡便不處理它

// (3) 韻核咽化
Expand All @@ -252,7 +254,7 @@ function 音位to音值(音節) {
if (音節.韻核.endsWith('ˤ')) 音節.替換('介音', 'ɹ', '');

// (5) 豪覃韻韻核寫作 ʌ
if (!is`三等` && is雙唇韻尾) 音節.替換('韻核', 'ə', 'ʌ');
if ((選項.豪覃?.includes('ʌ') || !(isJ2024 || isL)) && !is`三等` && is雙唇韻尾) 音節.替換('韻核', 'ə', 'ʌ');

// 後處理:按需顯示 ɑ,包括𦣛小韻(銳音歌三合)
if (選項.後低元音.length === 1)
Expand Down

0 comments on commit 5c6de54

Please sign in to comment.