nk2028 / qieyun-autoderiver

An automatic extrapolation tool based on the Tshet-uinh phonological system
https://nk2028.shn.hk/qieyun-autoderiver/
Creative Commons Zero v1.0 Universal
37 stars 13 forks source link

Version 0.2.0 #11

Open graphemecluster opened 2 years ago

graphemecluster commented 2 years ago

待實現功能參見 #10。

可以在這裏試用:https://graphemecluster.github.io/qieyun-autoderiver/

目前依靠 https://github.com/graphemecluster/qieyun-autoderiver-evaluate

先試試看,適配好 0.13 後沒問題就可以發佈了(不用等 #10 的功能全部實現)。

syimyuzya commented 2 years ago

好耶!

syimyuzya commented 2 years ago

對了話說那個 require 是要怎樣使用的呀?

graphemecluster commented 2 years ago

require 是用來擴展既有推導方案的,我待會兒寫個例子~

graphemecluster commented 2 years ago

↑ 適配好 0.13 之後再轉回來~

syimyuzya commented 2 years ago

先試試看,適配好 0.13 後沒問題就可以發佈了

對了,雖然說過最好和 qieyun-examples 的 API 統合,但推導器也可以直接在用上 Qieyun 0.13 的資料後就先行上線,之後再統合w

(估了一下 qieyun-examples(即 Qieyun.推導方案)工作量後的結論w

syimyuzya commented 2 years ago

適配好 0.13

啊對了~還有個要注意的點:

一些推導方案尚未適配 0.13,那些方案的選項列表裡都會有一項 ['$legacy', true],這個不要當成選項,要當成「標示其為 0.12 時代舊方案」的意思,給它們傳 音韻地位 前要對其做以下處理:

// 預先定義:
import { 表達式, 適配分析體系 } from 'qieyun';
const 適配poem = 適配分析體系('poem');

// 傳給舊方案前:
地位 = 適配poem(地位);
if (地位.屬於`脣音 或 ${表達式.開合中立韻}`) 地位 = 地位.調整({ 呼: null });
if (!地位.屬於`${表達式.重紐母} (${表達式.重紐韻} 或 清韻)`) 地位 = 地位.調整({ 重紐: null });

【↑代碼引自 qieyun-js 原本打算為推導器和 qieyun-examples 準備的共用 API

syimyuzya commented 2 years ago

由於 unt 的新版《聲音唱和圖》方案很快就會發佈,將基於 v0.13 的 Qieyun.js,為了便於公開使用,原界面已經升級為使用 v0.13 了。

新界面版本的話,應該可以跳過適配 Qieyun.js v0.13,直接與(開發中的)v0.14 相配合了w