Skip to content

Commit

Permalink
Upgrade for Qieyun v0.15
Browse files Browse the repository at this point in the history
- 音韻地位s updated
- Use Qieyun v0.15 for validation
  • Loading branch information
syimyuzya committed Aug 3, 2024
1 parent 0ccb530 commit a194b51
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Check
run: node check.js
run: npm test
10 changes: 6 additions & 4 deletions check.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import fs from 'fs';

import { 音韻地位, 適配分析體系 } from 'qieyun';
import { 音韻地位 } from 'qieyun';

const hanPattern =
/[\u3006\u3007\u4e00-\u9fff\u3400-\u4dbf\u{20000}-\u{2a6df}\u{2a700}-\u{2b73f}\u{2b740}-\u{2b81f}\u{2b820}-\u{2ceaf}\u{2ceb0}-\u{2ebef}\u{30000}-\u{3134f}]/u;
Expand Down Expand Up @@ -36,10 +36,12 @@ for (;;) {
chs.push(value);
}
const 描述 = chs.join('');
const 驗證描述 = 適配分析體系.v2Strict(音韻地位.from描述(描述)).描述;
if (驗證描述 !== 描述) {
const 地位 = 音韻地位.from描述(描述);
if (地位.描述 !== 描述) {
throw new Error(
`v2Strict returned non-identical 地位: ${描述} -> ${驗證描述}`,
`non-identical 地位 created from 描述: ${描述} -> ${地位.描述}`,
);
}
}

console.log('Test passed!');
Loading

0 comments on commit a194b51

Please sign in to comment.