Skip to content

Commit

Permalink
[ '墙', '墻', '牆' ]
Browse files Browse the repository at this point in the history
  • Loading branch information
bluelovers committed Dec 10, 2018
1 parent 147fae2 commit e2e87fb
Show file tree
Hide file tree
Showing 22 changed files with 76 additions and 18 deletions.
2 changes: 2 additions & 0 deletions build/zh/convert/table_cn2tw.debug.json
Expand Up @@ -2660,6 +2660,8 @@
"磐": "",
"磙": "",
"祐": "",
"祕": "",
"秘": "",
"竈": "",
"籲": "",
"紮": "",
Expand Down
4 changes: 3 additions & 1 deletion build/zh/convert/table_cn2tw.json
Expand Up @@ -2695,5 +2695,7 @@
"痺": "",
"痹": "",
"雇": "",
"僱": ""
"僱": "",
"秘": "",
"祕": ""
}
3 changes: 2 additions & 1 deletion build/zh/convert/table_tw2cn.debug.json
Expand Up @@ -2890,8 +2890,9 @@
"礆": "",
"礮": "",
"祐": "",
"祕": "",
"祕": "",
"禦": "",
"秘": "",
"稜": "",
"稭": "",
"穀": "",
Expand Down
5 changes: 3 additions & 2 deletions build/zh/convert/table_tw2cn.json
Expand Up @@ -1231,7 +1231,7 @@
"禮": "",
"禕": "",
"祐": "",
"祕": "",
"祕": "",
"禰": "",
"禎": "",
"禱": "",
Expand Down Expand Up @@ -3205,5 +3205,6 @@
"暗": "",
"布": "",
"痹": "",
"雇": ""
"雇": "",
"秘": ""
}
2 changes: 1 addition & 1 deletion build/zh/convert/unsafe/table_cn2tw.base.from.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/zh/convert/unsafe/table_cn2tw.base.to.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/zh/convert/unsafe/table_cn2tw.unicode.from.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/zh/convert/unsafe/table_cn2tw.unicode.to.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/zh/convert/unsafe/table_tw2cn.base.from.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/zh/convert/unsafe/table_tw2cn.base.to.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/zh/convert/unsafe/table_tw2cn.unicode.from.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/zh/convert/unsafe/table_tw2cn.unicode.to.txt

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions cjk-conv.d.ts
Expand Up @@ -384,6 +384,9 @@ declare module 'cjk-conv/lib/zh/table/table' {
'雇': string[];
'敘': string[];
'盪': string[];
'勛': string[];
'祕': string[];
'牆': string[];
};
export interface ISimpleTable {
[key: string]: string;
Expand Down
1 change: 1 addition & 0 deletions lib/jp/table.js
Expand Up @@ -63,6 +63,7 @@ const PLUS_TABLE = util_1.array_unique([
["鹹", "鹹", "咸"],
["踪", "蹤", "踪"],
["踪", "踪", "踪"],
["秘", "祕", "秘"],
]);
const PLUS_TABLE_SAFE = util_1.array_unique([
["絶", "絕", "绝"],
Expand Down
2 changes: 2 additions & 0 deletions lib/jp/table.ts
Expand Up @@ -100,6 +100,8 @@ const PLUS_TABLE: IPLUS_TABLE = array_unique<IPLUS_TABLE>([
["踪", "蹤", "踪"],
["踪", "踪", "踪"],

["秘", "祕", "秘"],

]);

const PLUS_TABLE_SAFE: IPLUS_TABLE = array_unique([
Expand Down
5 changes: 5 additions & 0 deletions lib/zh/convert/table.js
Expand Up @@ -83,6 +83,7 @@ exports.table_cn2tw = Object.assign(exports.table_cn2tw, {
'痳': '痲',
//'荡': '盪',
'荡': '蕩',
'墙': '牆',
});
exports.table_tw2cn = Object.assign(exports.table_tw2cn, {
'殻': '壳',
Expand Down Expand Up @@ -164,6 +165,8 @@ exports.table_tw2cn = Object.assign(exports.table_tw2cn, {
'蕩': '荡',
'盪': '荡',
'悽': '悽',
'牆': '墙',
'墻': '墙',
});
[
// 從轉換表中刪除的字
Expand Down Expand Up @@ -322,6 +325,8 @@ Object
'痹',
'雇',
'僱',
'秘',
'祕',
].forEach(function (v) {
exports.table_tw2cn[v] = v;
exports.table_cn2tw[v] = v;
Expand Down
8 changes: 8 additions & 0 deletions lib/zh/convert/table.ts
Expand Up @@ -120,6 +120,8 @@ table_cn2tw = Object.assign(table_cn2tw, {
//'荡': '盪',
'荡': '蕩',

'墙': '牆',

});

table_tw2cn = Object.assign(table_tw2cn, {
Expand Down Expand Up @@ -241,6 +243,9 @@ table_tw2cn = Object.assign(table_tw2cn, {

'悽': '悽',

'牆': '墙',
'墻': '墙',

});

[
Expand Down Expand Up @@ -426,6 +431,9 @@ Object
'雇',
'僱',

'秘',
'祕',

].forEach(function (v)
{
table_tw2cn[v] = v;
Expand Down
2 changes: 2 additions & 0 deletions lib/zh/table/table.d.ts
Expand Up @@ -241,6 +241,8 @@ export declare let table_plus: {
'敘': string[];
'盪': string[];
'勛': string[];
'祕': string[];
'牆': string[];
};
export interface ISimpleTable {
[key: string]: string;
Expand Down
9 changes: 9 additions & 0 deletions lib/zh/table/table.js
Expand Up @@ -1093,6 +1093,15 @@ exports.table_plus = {
'勳',
'勋',
],
'祕': [
'祕',
'秘',
],
'牆': [
'牆',
'墙',
'墻',
],
};
Object.keys(exports.table_plus)
.forEach(function (key) {
Expand Down
11 changes: 11 additions & 0 deletions lib/zh/table/table.ts
Expand Up @@ -1288,6 +1288,17 @@ export let table_plus = {
'勋',
],

'祕': [
'祕',
'秘',
],

'牆': [
'牆',
'墙',
'墻',
],

};

Object.keys(table_plus)
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "cjk-conv",
"version": "1.0.113",
"version": "1.1.0",
"description": "convert chinese, japanese 簡繁日漢字轉換 ( merge/split submodule from node-novel, regexp-cjk, str-util )",
"keywords": [
"char",
Expand Down
21 changes: 16 additions & 5 deletions test/list.ts
Expand Up @@ -11,7 +11,7 @@ import libTable from '../lib/zh/table';
import { cn2tw_min, tw2cn_min } from '../lib/zh/convert/min';
import { zhRegExp } from 'regexp-cjk';

let word = `悽淒凄`;
let word = `墻牆墙`;

word = array_unique(word.split('')).join('');

Expand All @@ -21,10 +21,10 @@ console.log(`zhRegExp Unicode\n`, new zhRegExp(word, 'u'));
console.log('charTableList\n', charTableList(word));
console.log('textList\n', textList(word));

console.log('libTable.auto\n', libTable.auto(word));
console.log('libTable.tw\n', libTable.tw(word));
console.log('libTable.cn\n', libTable.cn(word));
console.log('libTable.jp\n', libTable.jp(word));
console.log('libTable.auto\n', _table_each(word, libTable.auto));
console.log('libTable.tw\n', _table_each(word, libTable.tw));
console.log('libTable.cn\n', _table_each(word, libTable.cn));
console.log('libTable.jp\n', _table_each(word, libTable.jp));

console.log('cn2tw', cn2tw(word));
console.log('tw2cn', tw2cn(word));
Expand All @@ -36,3 +36,14 @@ console.log('jp2zht', jp2zht(word));
console.log('jp2zhs', jp2zhs(word));
console.log('zh2jp', zh2jp(word));


function _table_each(word: string, fn: (char: string) => string[])
{
return array_unique(word.split('')
.reduce(function (a, b)
{
a.push(...fn(b));

return a;
}, [] as string[]))
}

0 comments on commit e2e87fb

Please sign in to comment.