Comparing version 1.2.56 to 1.2.57
@@ -6,2 +6,10 @@ # Change Log | ||
## [1.2.57](https://github.com/bluelovers/cjk-convert/compare/cjk-conv@1.2.56...cjk-conv@1.2.57) (2020-05-28) | ||
**Note:** Version bump only for package cjk-conv | ||
## [1.2.56](https://github.com/bluelovers/cjk-convert/compare/cjk-conv@1.2.55...cjk-conv@1.2.56) (2020-05-28) | ||
@@ -8,0 +16,0 @@ |
/** | ||
* Created by user on 2019/7/26. | ||
*/ | ||
import { IKEY_FROM_TO } from './core'; | ||
export interface IOptions { | ||
safe?: boolean; | ||
includeSelf?: boolean; | ||
} | ||
export declare function _fromA2B(char: string, from: IKEY_FROM_TO, to: IKEY_FROM_TO, options?: IOptions): string[]; | ||
export declare function jp2zht(char: string, options?: IOptions): string[]; | ||
export declare function jp2zhs(char: string, options?: IOptions): string[]; | ||
export declare function zht2jp(char: string, options?: IOptions): string[]; | ||
export declare function zhs2jp(char: string, options?: IOptions): string[]; | ||
export declare function zh2jp(char: string, options?: IOptions): string[]; | ||
export declare function jp2zh(char: string, options?: IOptions): string[]; | ||
export declare function lazyAll(char: string, options?: IOptions): string[]; | ||
declare const _default: typeof import("./list"); | ||
export default _default; | ||
export * from '@lazy-cjk/jp-table-alias'; | ||
import m from '@lazy-cjk/jp-table-alias'; | ||
export default m; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.lazyAll = exports.jp2zh = exports.zh2jp = exports.zhs2jp = exports.zht2jp = exports.jp2zhs = exports.jp2zht = exports._fromA2B = void 0; | ||
/** | ||
* Created by user on 2019/7/26. | ||
*/ | ||
const core_1 = require("./core"); | ||
const array_hyper_unique_1 = require("array-hyper-unique"); | ||
function _fromA2B(char, from, to, options = {}) { | ||
const _table = options && options.safe ? core_1.TABLE_SAFE : core_1.TABLE; | ||
if (_table[from] && _table[to]) { | ||
let list = []; | ||
if (_table[from][char]) { | ||
if (_table[from][char][to]) { | ||
list.push(_table[from][char][to]); | ||
} | ||
Object.values(_table[to]) | ||
.forEach(row => { | ||
if (row[from] === char && row[to]) { | ||
list.push(row[to]); | ||
} | ||
}); | ||
if (options && options.includeSelf) { | ||
list.push(char); | ||
} | ||
list = array_hyper_unique_1.array_unique_overwrite(list); | ||
} | ||
return list; | ||
} | ||
throw new RangeError(`${from}, ${to} is not exists in TABLE`); | ||
} | ||
exports._fromA2B = _fromA2B; | ||
function jp2zht(char, options) { | ||
return _fromA2B(char, core_1.KEY_JP, core_1.KEY_ZHT, options); | ||
} | ||
exports.jp2zht = jp2zht; | ||
function jp2zhs(char, options) { | ||
return _fromA2B(char, core_1.KEY_JP, core_1.KEY_ZHS, options); | ||
} | ||
exports.jp2zhs = jp2zhs; | ||
function zht2jp(char, options) { | ||
return _fromA2B(char, core_1.KEY_ZHT, core_1.KEY_JP, options); | ||
} | ||
exports.zht2jp = zht2jp; | ||
function zhs2jp(char, options) { | ||
return _fromA2B(char, core_1.KEY_ZHS, core_1.KEY_JP, options); | ||
} | ||
exports.zhs2jp = zhs2jp; | ||
function zh2jp(char, options) { | ||
let arr = zht2jp(char, options) | ||
.concat(zhs2jp(char, options)); | ||
return array_hyper_unique_1.array_unique_overwrite(arr); | ||
} | ||
exports.zh2jp = zh2jp; | ||
function jp2zh(char, options) { | ||
let arr = jp2zht(char, options) | ||
.concat(jp2zhs(char, options)); | ||
return array_hyper_unique_1.array_unique_overwrite(arr); | ||
} | ||
exports.jp2zh = jp2zh; | ||
function lazyAll(char, options) { | ||
let arr = zh2jp(char, options) | ||
.reduce((a, b) => { | ||
a.push(b, ...jp2zh(b, options)); | ||
return a; | ||
}, []) | ||
.concat(jp2zh(char, options) | ||
.reduce((a, b) => { | ||
a.push(b, ...zh2jp(b, options)); | ||
return a; | ||
}, [])); | ||
return array_hyper_unique_1.array_unique_overwrite(arr); | ||
} | ||
exports.lazyAll = lazyAll; | ||
exports.default = exports; | ||
__exportStar(require("@lazy-cjk/jp-table-alias"), exports); | ||
const jp_table_alias_1 = __importDefault(require("@lazy-cjk/jp-table-alias")); | ||
exports.default = jp_table_alias_1.default; | ||
//# sourceMappingURL=list.js.map |
/** | ||
* Created by user on 2018/2/17/017. | ||
*/ | ||
export interface IOptions { | ||
skip?: string; | ||
safe?: boolean; | ||
} | ||
export declare function filename(name: string, options?: IOptions): string; | ||
export declare function word(name: string, options?: IOptions): string; | ||
export declare function jp(txt: string, options?: IOptions): string; | ||
export declare function zh(txt: string, options?: IOptions): string; | ||
declare const _default: typeof import("./filename"); | ||
export default _default; | ||
export * from '@lazy-cjk/novel-filename'; | ||
import m from '@lazy-cjk/novel-filename'; | ||
export default m; |
@@ -5,63 +5,19 @@ "use strict"; | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.zh = exports.jp = exports.word = exports.filename = void 0; | ||
const jp_1 = require("../jp"); | ||
const convert_1 = require("../zh/convert"); | ||
function filename(name, options = {}) { | ||
return jp(name, options) | ||
.replace(/·/g, '・'); | ||
} | ||
exports.filename = filename; | ||
function word(name, options = {}) { | ||
return jp(name, options); | ||
} | ||
exports.word = word; | ||
function jp(txt, options = {}) { | ||
return zh(jp_1.zh2jp(zh(txt), { | ||
// @ts-ignore | ||
skip: '竜龍制征里像拜冰澤涉丑兒娘姐姉志儿從辨勞' + (options.skip || ''), | ||
safe: typeof options.safe == 'boolean' ? options.safe : true, | ||
})) | ||
.replace(/诅/g, '詛') | ||
.replace(/复仇/g, '復仇') | ||
.replace(/戦斗/g, '戦闘') | ||
.replace(/^プロローグ/, '序') | ||
.replace(/^エピローグ/, '終章') | ||
.replace(/総/g, '總') | ||
.replace(/帰|归/g, '歸') | ||
.replace(/辺/g, '邊') | ||
.replace(/対/g, '對') | ||
.replace(/独/g, '獨') | ||
.replace(/実/g, '實') | ||
.replace(/決斗/g, '決闘') | ||
.replace(/仮/g, '假') | ||
.replace(/戦/g, '戰'); | ||
} | ||
exports.jp = jp; | ||
function zh(txt, options = {}) { | ||
return txt | ||
.replace(/[\u2000-\u200F]/g, '') | ||
.replace(/[\u2028-\u202F]/g, '') | ||
.replace(/[\u205F-\u2060]/g, '') | ||
//.replace(/儿/g, '兒') | ||
.replace(/与/g, '與') | ||
.replace(/[亜亚亞]/g, '亞') | ||
.replace(/価/, '價') | ||
.replace(/[觉覚覺]/g, '覺') | ||
.replace(/亏/g, '虧') | ||
.replace(/[·‧・···•]/g, '・') | ||
.replace(/泽/g, '澤') | ||
.replace(/^(?:后)(記|日)/, '後$1') | ||
.replace(/(身)(?:后)/, '$1後') | ||
.replace(/(?:后)(悔)/, '後$1') | ||
.replace(/回复/g, '回復') | ||
.replace(/复(仇|讐)/g, '復$1') | ||
.replace(/里面/g, '裡面') | ||
.replace(/([今此])后/g, '$1後') | ||
.replace(/[么预枪丛迈这个尔儿从龙丝风劳弃别驯卢妈称号]+/ug, function (s) { | ||
return convert_1.cn2tw(s); | ||
}); | ||
} | ||
exports.zh = zh; | ||
exports.default = exports; | ||
__exportStar(require("@lazy-cjk/novel-filename"), exports); | ||
const novel_filename_1 = __importDefault(require("@lazy-cjk/novel-filename")); | ||
exports.default = novel_filename_1.default; | ||
//# sourceMappingURL=filename.js.map |
/** | ||
* Created by user on 2018/7/29/029. | ||
*/ | ||
export interface IOptions { | ||
coreJs?: boolean; | ||
ignore?: boolean; | ||
} | ||
export declare function toStrTableArray(table: { | ||
[k: string]: string; | ||
}, options?: IOptions): { | ||
from: any[]; | ||
to: any[]; | ||
}; | ||
export declare function toStrTable(table: { | ||
[k: string]: string; | ||
}, options?: IOptions): { | ||
from: string; | ||
to: string; | ||
}; | ||
export declare function jsSplit(s: string): string[]; | ||
export declare function utf8Split(s: string): string[]; | ||
declare const _default: typeof import("./strtable"); | ||
export default _default; | ||
export * from '@lazy-cjk/util/strtable'; | ||
import m from '@lazy-cjk/util/strtable'; | ||
export default m; |
@@ -5,2 +5,12 @@ "use strict"; | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -10,57 +20,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.utf8Split = exports.jsSplit = exports.toStrTable = exports.toStrTableArray = void 0; | ||
const uni_string_1 = __importDefault(require("uni-string")); | ||
function toStrTableArray(table, options = {}) { | ||
if (typeof table !== 'object' || Array.isArray(table)) { | ||
throw new TypeError(`table '${typeof table}' ${table}`); | ||
} | ||
let from = []; | ||
let to = []; | ||
const ks = Object.keys(table); | ||
ks.sort(); | ||
let split = options.coreJs ? jsSplit : utf8Split; | ||
for (let k of ks) { | ||
let k2 = table[k]; | ||
let s1 = split(k); | ||
let s2 = split(k2); | ||
if (s1.length !== 1 || s2.length !== 1) { | ||
let msg = `'${k}' s1: ${s1.length} ${s1} ; s2: ${s2.length} ${s2}`; | ||
if (options.ignore) { | ||
console.error(msg); | ||
continue; | ||
} | ||
else { | ||
//console.dir(s1); | ||
//console.dir(s2); | ||
throw new TypeError(msg); | ||
break; | ||
} | ||
} | ||
from.push(k); | ||
to.push(k2); | ||
} | ||
return { | ||
from, | ||
to, | ||
}; | ||
} | ||
exports.toStrTableArray = toStrTableArray; | ||
function toStrTable(table, options) { | ||
let { from, to, } = toStrTableArray(table, options); | ||
return { | ||
from: from.join(''), | ||
to: to.join(''), | ||
}; | ||
} | ||
exports.toStrTable = toStrTable; | ||
function jsSplit(s) { | ||
return s.split(''); | ||
} | ||
exports.jsSplit = jsSplit; | ||
function utf8Split(s) { | ||
return uni_string_1.default.split(s, ''); | ||
} | ||
exports.utf8Split = utf8Split; | ||
exports.default = exports; | ||
//console.log(__filename, require.extensions); | ||
__exportStar(require("@lazy-cjk/util/strtable"), exports); | ||
const strtable_1 = __importDefault(require("@lazy-cjk/util/strtable")); | ||
exports.default = strtable_1.default; | ||
//# sourceMappingURL=strtable.js.map |
/** | ||
* Created by user on 2018/8/2/002. | ||
*/ | ||
export interface ITable { | ||
[key: string]: string; | ||
} | ||
export declare function charMap(s: string, table: ITable): string; | ||
export declare function textMap1(text: string, table: ITable): string; | ||
export declare function textMap2(text: string, table: ITable): string; | ||
export declare function textMap3(text: string, table: ITable): string; | ||
export declare function textMap4(text: string, table: ITable): string; | ||
export { textMap4 as textMap }; | ||
export * from '@lazy-cjk/zh-convert/lib/core/map'; | ||
export * from '@lazy-cjk/zh-convert/lib/types'; | ||
export * from '@lazy-cjk/zh-convert/lib/util/map'; | ||
export * from '@lazy-cjk/zh-convert/lib/util'; | ||
export * from '@lazy-cjk/zh-convert/lib/const'; | ||
declare const _default: typeof import("./core"); | ||
export default _default; | ||
export declare function removeSame(table: ITable): ITable; | ||
export interface IOptions { | ||
/** | ||
* 忽略的字 or 任何支援 indexOf 的 Object | ||
*/ | ||
skip?: any; | ||
table?: ITable | typeof _call; | ||
safe?: boolean; | ||
tableOnly?: boolean; | ||
} | ||
export declare const defaultOptions: Readonly<{ | ||
safe: boolean; | ||
}>; | ||
export declare const REGEXP_TEST: RegExp; | ||
export declare const SAFE_MODE_CHAR: string[]; | ||
export declare function getOptionsSkip(options: IOptions, skip?: string[]): IOptions; | ||
export declare function getOptions(options?: IOptions, defaultOpts?: Readonly<{ | ||
safe: boolean; | ||
}>, skip?: string[]): IOptions; | ||
export declare function _call(fn: any, text: string, options?: IOptions, ...argv: any[]): any; |
@@ -5,145 +5,19 @@ "use strict"; | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._call = exports.getOptions = exports.getOptionsSkip = exports.SAFE_MODE_CHAR = exports.REGEXP_TEST = exports.defaultOptions = exports.removeSame = exports.textMap = exports.textMap4 = exports.textMap3 = exports.textMap2 = exports.textMap1 = exports.charMap = void 0; | ||
const array_hyper_unique_1 = require("array-hyper-unique"); | ||
const uni_string_1 = __importDefault(require("uni-string")); | ||
const cjk_conv_1 = require("regexp-helper/lib/cjk-conv"); | ||
function charMap(s, table) { | ||
let t = table[s]; | ||
return (typeof t === 'string') ? t : s; | ||
} | ||
exports.charMap = charMap; | ||
function textMap1(text, table) { | ||
let toText = []; | ||
let len = text.length; | ||
for (let i = 0; i < len; i++) { | ||
toText[i] = charMap(text[i], table); | ||
} | ||
//console.log(toText.length, toText); | ||
return toText.join(''); | ||
} | ||
exports.textMap1 = textMap1; | ||
function textMap2(text, table) { | ||
let toText = uni_string_1.default.split(text, ''); | ||
let len = toText.length; | ||
for (let i = 0; i < len; i++) { | ||
toText[i] = charMap(toText[i], table); | ||
} | ||
//console.log(toText.length, toText); | ||
return toText.join(''); | ||
} | ||
exports.textMap2 = textMap2; | ||
function textMap3(text, table) { | ||
let toText = text.split(/(?:)/u); | ||
let len = toText.length; | ||
for (let i = 0; i < len; i++) { | ||
toText[i] = charMap(toText[i], table); | ||
} | ||
//console.log(toText.length, toText); | ||
return toText.join(''); | ||
} | ||
exports.textMap3 = textMap3; | ||
function textMap4(text, table) { | ||
return text.replace(exports.REGEXP_TEST, function (s) { | ||
return charMap(s, table); | ||
}); | ||
} | ||
exports.textMap4 = textMap4; | ||
exports.textMap = textMap4; | ||
const textMap = textMap4; | ||
__exportStar(require("@lazy-cjk/zh-convert/lib/core/map"), exports); | ||
__exportStar(require("@lazy-cjk/zh-convert/lib/types"), exports); | ||
__exportStar(require("@lazy-cjk/zh-convert/lib/util/map"), exports); | ||
__exportStar(require("@lazy-cjk/zh-convert/lib/util"), exports); | ||
__exportStar(require("@lazy-cjk/zh-convert/lib/const"), exports); | ||
exports.default = exports; | ||
function removeSame(table) { | ||
return Object.entries(table) | ||
.reduce(function (a, b) { | ||
let [k, v] = b; | ||
if (k != v) { | ||
a[k] = v; | ||
} | ||
return a; | ||
}, {}); | ||
} | ||
exports.removeSame = removeSame; | ||
exports.defaultOptions = Object.freeze({ | ||
safe: true, | ||
}); | ||
exports.REGEXP_TEST = cjk_conv_1._re_cjk_conv('ug'); | ||
exports.SAFE_MODE_CHAR = array_hyper_unique_1.array_unique([ | ||
'后', | ||
'里', | ||
'餵', | ||
'志', | ||
'布', | ||
'佈', | ||
'系', | ||
'繫', | ||
'梁', | ||
'樑', | ||
'衝', | ||
'沖', | ||
'谷', | ||
'穀', | ||
'注', | ||
'克', | ||
]); | ||
function getOptionsSkip(options, skip = exports.SAFE_MODE_CHAR) { | ||
if (!options.skip) { | ||
options.skip = skip.slice(); | ||
} | ||
else if (typeof options.skip == 'string') { | ||
options.skip += skip.join(''); | ||
} | ||
else if (Array.isArray(options.skip)) { | ||
options.skip = options.skip.slice().concat(skip); | ||
} | ||
else { | ||
options.table = skip.reduce(function (a, b) { | ||
a[b] = b; | ||
return a; | ||
}, Object.assign({}, options.table || {})); | ||
} | ||
return options; | ||
} | ||
exports.getOptionsSkip = getOptionsSkip; | ||
function getOptions(options = {}, defaultOpts = exports.defaultOptions, skip = exports.SAFE_MODE_CHAR) { | ||
options = Object.assign({}, defaultOpts, options); | ||
if (options.safe) { | ||
options = getOptionsSkip(options, skip); | ||
//console.log(options); | ||
} | ||
return options; | ||
} | ||
exports.getOptions = getOptions; | ||
function _call(fn, text, options = {}, ...argv) { | ||
options = getOptions(options); | ||
if (options.skip || options.table || options.tableOnly) { | ||
let { skip, table, tableOnly } = options; | ||
let not_tableOnly = !tableOnly; | ||
if (tableOnly && !table) { | ||
throw new Error(`table is ${table}`); | ||
} | ||
return text.replace(exports.REGEXP_TEST, function (text) { | ||
if (skip && skip.indexOf(text) !== -1) { | ||
return text; | ||
} | ||
else if (table && typeof table == 'function') { | ||
let ret = table(fn, text, options, ...argv); | ||
if (ret !== null && typeof ret != 'undefined') { | ||
return ret; | ||
} | ||
} | ||
else if (table && table[text]) { | ||
return table[text]; | ||
} | ||
else if (not_tableOnly) { | ||
return fn(text); | ||
} | ||
return text; | ||
}); | ||
} | ||
return fn(text, options, ...argv); | ||
} | ||
exports._call = _call; | ||
//# sourceMappingURL=core.js.map |
@@ -6,11 +6,14 @@ /** | ||
*/ | ||
import { _call, defaultOptions, getOptions, getOptionsSkip, IOptions, ITable, REGEXP_TEST, SAFE_MODE_CHAR } from './core'; | ||
export declare function cn2tw(text: string, options?: IOptions, ...argv: any[]): string; | ||
export declare function tw2cn(text: string, options?: IOptions, ...argv: any[]): string; | ||
export declare let table_cn2tw: ITable; | ||
export declare let table_tw2cn: ITable; | ||
export declare function _cn2tw(text: string): string; | ||
export declare function _tw2cn(text: string): string; | ||
import { _call, getOptions, getOptionsSkip } from '@lazy-cjk/zh-convert/lib/util'; | ||
import { IOptions } from '@lazy-cjk/jp-table-convert/lib/types'; | ||
import { ITable } from '@lazy-cjk/zh-convert/lib/types'; | ||
import { defaultOptions, REGEXP_TEST, SAFE_MODE_CHAR } from '@lazy-cjk/zh-convert/lib/const'; | ||
import { cn2tw, tw2cn } from '@lazy-cjk/zh-convert'; | ||
import { _cn2tw, _tw2cn } from '@lazy-cjk/zh-convert/lib/core'; | ||
import { table_cn2tw, table_tw2cn } from '@lazy-cjk/zh-convert/lib/table'; | ||
export { cn2tw, tw2cn }; | ||
export { _cn2tw, _tw2cn }; | ||
export { table_cn2tw, table_tw2cn }; | ||
export { _call, IOptions, ITable, getOptions, defaultOptions, REGEXP_TEST, getOptionsSkip, SAFE_MODE_CHAR, }; | ||
declare const _default: typeof import("."); | ||
export default _default; |
@@ -8,33 +8,20 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SAFE_MODE_CHAR = exports.getOptionsSkip = exports.REGEXP_TEST = exports.defaultOptions = exports.getOptions = exports._call = exports._tw2cn = exports._cn2tw = exports.table_tw2cn = exports.table_cn2tw = exports.tw2cn = exports.cn2tw = void 0; | ||
//import { cn2tw as _cn2tw, tw2cn as _tw2cn } from 'chinese_convert'; | ||
const table_1 = require("./table"); | ||
const core_1 = require("./core"); | ||
Object.defineProperty(exports, "_call", { enumerable: true, get: function () { return core_1._call; } }); | ||
Object.defineProperty(exports, "defaultOptions", { enumerable: true, get: function () { return core_1.defaultOptions; } }); | ||
Object.defineProperty(exports, "getOptions", { enumerable: true, get: function () { return core_1.getOptions; } }); | ||
Object.defineProperty(exports, "getOptionsSkip", { enumerable: true, get: function () { return core_1.getOptionsSkip; } }); | ||
Object.defineProperty(exports, "REGEXP_TEST", { enumerable: true, get: function () { return core_1.REGEXP_TEST; } }); | ||
Object.defineProperty(exports, "SAFE_MODE_CHAR", { enumerable: true, get: function () { return core_1.SAFE_MODE_CHAR; } }); | ||
const table_plus_1 = require("./table_plus"); | ||
function cn2tw(text, options = {}, ...argv) { | ||
return core_1._call(_cn2tw, text, options, ...argv); | ||
} | ||
exports.cn2tw = cn2tw; | ||
function tw2cn(text, options = {}, ...argv) { | ||
return core_1._call(_tw2cn, text, options, ...argv); | ||
} | ||
exports.tw2cn = tw2cn; | ||
exports.table_cn2tw = Object.assign({}, table_1.table_cn2tw, table_plus_1.table_cn2tw_plus); | ||
exports.table_tw2cn = Object.assign({}, table_1.table_tw2cn, table_plus_1.table_tw2cn_plus); | ||
function _cn2tw(text) { | ||
// @ts-ignore | ||
return core_1.textMap(text, exports.table_cn2tw); | ||
} | ||
exports._cn2tw = _cn2tw; | ||
function _tw2cn(text) { | ||
// @ts-ignore | ||
return core_1.textMap(text, exports.table_tw2cn); | ||
} | ||
exports._tw2cn = _tw2cn; | ||
exports.SAFE_MODE_CHAR = exports.getOptionsSkip = exports.REGEXP_TEST = exports.defaultOptions = exports.getOptions = exports._call = exports.table_tw2cn = exports.table_cn2tw = exports._tw2cn = exports._cn2tw = exports.tw2cn = exports.cn2tw = void 0; | ||
const util_1 = require("@lazy-cjk/zh-convert/lib/util"); | ||
Object.defineProperty(exports, "_call", { enumerable: true, get: function () { return util_1._call; } }); | ||
Object.defineProperty(exports, "getOptions", { enumerable: true, get: function () { return util_1.getOptions; } }); | ||
Object.defineProperty(exports, "getOptionsSkip", { enumerable: true, get: function () { return util_1.getOptionsSkip; } }); | ||
const const_1 = require("@lazy-cjk/zh-convert/lib/const"); | ||
Object.defineProperty(exports, "defaultOptions", { enumerable: true, get: function () { return const_1.defaultOptions; } }); | ||
Object.defineProperty(exports, "REGEXP_TEST", { enumerable: true, get: function () { return const_1.REGEXP_TEST; } }); | ||
Object.defineProperty(exports, "SAFE_MODE_CHAR", { enumerable: true, get: function () { return const_1.SAFE_MODE_CHAR; } }); | ||
const zh_convert_1 = require("@lazy-cjk/zh-convert"); | ||
Object.defineProperty(exports, "cn2tw", { enumerable: true, get: function () { return zh_convert_1.cn2tw; } }); | ||
Object.defineProperty(exports, "tw2cn", { enumerable: true, get: function () { return zh_convert_1.tw2cn; } }); | ||
const core_1 = require("@lazy-cjk/zh-convert/lib/core"); | ||
Object.defineProperty(exports, "_cn2tw", { enumerable: true, get: function () { return core_1._cn2tw; } }); | ||
Object.defineProperty(exports, "_tw2cn", { enumerable: true, get: function () { return core_1._tw2cn; } }); | ||
const table_1 = require("@lazy-cjk/zh-convert/lib/table"); | ||
Object.defineProperty(exports, "table_cn2tw", { enumerable: true, get: function () { return table_1.table_cn2tw; } }); | ||
Object.defineProperty(exports, "table_tw2cn", { enumerable: true, get: function () { return table_1.table_tw2cn; } }); | ||
exports.default = exports; | ||
@@ -41,0 +28,0 @@ //console.log(cn2tw('轉换最里后裡後轉换最后')); |
/** | ||
* Created by user on 2018/7/29/029. | ||
*/ | ||
import tableTw2CnDebug from '../../../build/zh/convert/table_tw2cn.debug.json'; | ||
import tableCn2TwDebug from '../../../build/zh/convert/table_cn2tw.debug.json'; | ||
import { IOptions, ITable } from './core'; | ||
export { tableTw2CnDebug, tableCn2TwDebug }; | ||
export declare const SAFE_MODE_CHAR_MIN: string[]; | ||
export { SAFE_MODE_CHAR_MIN as SAFE_MODE_CHAR }; | ||
/** | ||
* 以不造成歧異的字典表來取代 | ||
*/ | ||
export declare function tw2cn_min(text: string, options?: IOptions, ...argv: any[]): string; | ||
/** | ||
* 以不造成歧異的字典表來取代 | ||
*/ | ||
export declare function cn2tw_min(text: string, options?: IOptions, ...argv: any[]): string; | ||
export declare function fixOptions(options: IOptions, table: ITable): IOptions; | ||
export * from '@lazy-cjk/zh-convert/min'; | ||
export * from '@lazy-cjk/zh-convert/lib/min/index'; | ||
export * from '@lazy-cjk/zh-convert/lib/min/const'; | ||
export * from '@lazy-cjk/zh-convert/lib/min/util'; | ||
declare const _default: typeof import("./min"); | ||
export default _default; |
@@ -5,74 +5,18 @@ "use strict"; | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fixOptions = exports.cn2tw_min = exports.tw2cn_min = exports.SAFE_MODE_CHAR = exports.SAFE_MODE_CHAR_MIN = exports.tableCn2TwDebug = exports.tableTw2CnDebug = void 0; | ||
const table_tw2cn_debug_json_1 = __importDefault(require("../../../build/zh/convert/table_tw2cn.debug.json")); | ||
exports.tableTw2CnDebug = table_tw2cn_debug_json_1.default; | ||
const table_cn2tw_debug_json_1 = __importDefault(require("../../../build/zh/convert/table_cn2tw.debug.json")); | ||
exports.tableCn2TwDebug = table_cn2tw_debug_json_1.default; | ||
const core_1 = require("./core"); | ||
const index_1 = require("./index"); | ||
const array_hyper_unique_1 = require("array-hyper-unique"); | ||
exports.SAFE_MODE_CHAR_MIN = array_hyper_unique_1.array_unique(core_1.SAFE_MODE_CHAR | ||
.slice() | ||
.concat([ | ||
//'忧', | ||
//'脏', | ||
'划', | ||
'准', | ||
'发', | ||
'処', | ||
//'处', | ||
'處', | ||
//'憂', | ||
//'優', | ||
'餵', | ||
'炮', | ||
'砲', | ||
'奸', | ||
'姦', | ||
'鱷', | ||
'滷', | ||
'鑑', | ||
'發', | ||
])); | ||
exports.SAFE_MODE_CHAR = exports.SAFE_MODE_CHAR_MIN; | ||
/** | ||
* 以不造成歧異的字典表來取代 | ||
*/ | ||
function tw2cn_min(text, options = {}, ...argv) { | ||
options = fixOptions(options, table_tw2cn_debug_json_1.default.safe); | ||
return index_1.tw2cn(text, options, ...argv); | ||
} | ||
exports.tw2cn_min = tw2cn_min; | ||
/** | ||
* 以不造成歧異的字典表來取代 | ||
*/ | ||
function cn2tw_min(text, options = {}, ...argv) { | ||
options = fixOptions(options, table_cn2tw_debug_json_1.default.safe); | ||
return index_1.cn2tw(text, options, ...argv); | ||
} | ||
exports.cn2tw_min = cn2tw_min; | ||
function fixOptions(options = {}, table) { | ||
options = Object.assign({}, options); | ||
options.table = options.table || Object.create(table); | ||
options.tableOnly = options.tableOnly !== false; | ||
options = core_1.getOptions(options, core_1.defaultOptions, exports.SAFE_MODE_CHAR_MIN); | ||
return options; | ||
} | ||
exports.fixOptions = fixOptions; | ||
/* | ||
let msg = `并且之后在深海変異成亚种的半人鱼。顺便说一句,当时人鱼国的守护神《海之神》特里斯坦,发现在神代时代时被自己封印的宿敌复活了忧。`; | ||
console.log(1, cn2tw(msg, { | ||
safe: false, | ||
})); | ||
console.log(2, cn2tw_min(msg, { | ||
//safe: false, | ||
})); | ||
*/ | ||
__exportStar(require("@lazy-cjk/zh-convert/min"), exports); | ||
__exportStar(require("@lazy-cjk/zh-convert/lib/min/index"), exports); | ||
__exportStar(require("@lazy-cjk/zh-convert/lib/min/const"), exports); | ||
__exportStar(require("@lazy-cjk/zh-convert/lib/min/util"), exports); | ||
exports.default = exports; | ||
//# sourceMappingURL=min.js.map |
@@ -1,4 +0,2 @@ | ||
/** | ||
* 用來測試字串切割是否正確用的列表 | ||
*/ | ||
export declare const unsafeChinese: readonly ["𠮷", "𠬠", "𡬶", "𫗭", "𣛙", "𢎐"]; | ||
import { unsafeChinese } from '@lazy-cjk/util'; | ||
export { unsafeChinese }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.unsafeChinese = void 0; | ||
/** | ||
* 用來測試字串切割是否正確用的列表 | ||
*/ | ||
exports.unsafeChinese = [ | ||
'𠮷', '𠬠', '𡬶', '𫗭', '𣛙', '𢎐', | ||
]; | ||
const util_1 = require("@lazy-cjk/util"); | ||
Object.defineProperty(exports, "unsafeChinese", { enumerable: true, get: function () { return util_1.unsafeChinese; } }); | ||
//# sourceMappingURL=unsafe.js.map |
/** | ||
* Created by user on 2018/2/17/017. | ||
*/ | ||
import libTable from './table'; | ||
import libTable from '@lazy-cjk/zh-table-alias'; | ||
import { _get } from '@lazy-cjk/zh-table-list/lib/util'; | ||
export * from '@lazy-cjk/zh-table-list/lib/types'; | ||
export * from '@lazy-cjk/zh-table-list'; | ||
export { libTable }; | ||
export declare type IOptions = { | ||
safe?: boolean; | ||
skip?: any; | ||
greedyTable?: boolean | number; | ||
}; | ||
export declare function _get(a: any, value: any, ...values: any[]): any; | ||
/** | ||
* 取出此漢字所對應的繁漢字 | ||
* @type {(char: string, options?: IOptions) => string[]} | ||
*/ | ||
export declare const tw: (char: string, options?: IOptions) => string[]; | ||
/** | ||
* 取出此漢字所對應的簡漢字 | ||
* @type {(char: string, options?: IOptions) => string[]} | ||
*/ | ||
export declare const cn: (char: string, options?: IOptions) => string[]; | ||
/** | ||
* 取出此漢字所對應的日漢字 | ||
* @type {(char: string, options?: IOptions) => string[]} | ||
*/ | ||
export declare const jp: (char: string, options?: IOptions) => string[]; | ||
/** | ||
* 自動取出此漢字所對應的簡繁日漢字 | ||
* | ||
* @param {string} char | ||
* @param {IOptions} options | ||
* @returns {string[]} | ||
*/ | ||
export declare function auto(char: string, options?: IOptions): string[]; | ||
export { _get }; | ||
declare const _default: typeof import("."); | ||
export default _default; |
@@ -5,2 +5,12 @@ "use strict"; | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -10,87 +20,10 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.auto = exports.jp = exports.cn = exports.tw = exports._get = exports.libTable = void 0; | ||
const jp_1 = require("../../jp"); | ||
const table_1 = __importDefault(require("./table")); | ||
exports.libTable = table_1.default; | ||
const array_hyper_unique_1 = require("array-hyper-unique"); | ||
const zh_table_greedy_1 = require("@lazy-cjk/zh-table-greedy"); | ||
const list_1 = __importDefault(require("../../jp/list")); | ||
function _get(a, value, ...values) { | ||
a = table_1.default._get(a, value, ...values); | ||
return array_hyper_unique_1.array_unique(a).sort(); | ||
} | ||
exports._get = _get; | ||
function _wrapFn(fn) { | ||
return function (char, options = {}) { | ||
if (!char) { | ||
return null; | ||
} | ||
if (options.skip && options.skip.indexOf(char) != -1) { | ||
return [char]; | ||
} | ||
let a = table_1.default[fn](char, options); | ||
a = array_hyper_unique_1.array_unique(a); | ||
a.sort(); | ||
return a; | ||
}; | ||
} | ||
/** | ||
* 取出此漢字所對應的繁漢字 | ||
* @type {(char: string, options?: IOptions) => string[]} | ||
*/ | ||
exports.tw = _wrapFn('tw'); | ||
/** | ||
* 取出此漢字所對應的簡漢字 | ||
* @type {(char: string, options?: IOptions) => string[]} | ||
*/ | ||
exports.cn = _wrapFn('cn'); | ||
/** | ||
* 取出此漢字所對應的日漢字 | ||
* @type {(char: string, options?: IOptions) => string[]} | ||
*/ | ||
exports.jp = _wrapFn('jp'); | ||
/** | ||
* 自動取出此漢字所對應的簡繁日漢字 | ||
* | ||
* @param {string} char | ||
* @param {IOptions} options | ||
* @returns {string[]} | ||
*/ | ||
function auto(char, options = {}) { | ||
if (!char) { | ||
return null; | ||
} | ||
if (options.skip && options.skip.indexOf(char) != -1) { | ||
return [char]; | ||
} | ||
let jt = jp_1.jp2zht(char); | ||
let js = jp_1.jp2zhs(char); | ||
let greedyTable = options.greedyTable | 0; | ||
let a = _get([], char, table_1.default.tw(char, options), table_1.default.cn(char, options), (!options.skip || options.skip.indexOf(jt) == -1) && table_1.default.cn(jt, options), (!options.skip || options.skip.indexOf(js) == -1) && table_1.default.tw(js, options), table_1.default.jp(char, options), (greedyTable && jp_1.cjk2jp(char)), (greedyTable && jp_1.cjk2zhs(char)), (greedyTable && jp_1.cjk2zht(char)), (greedyTable && list_1.default.zh2jp(char, { | ||
safe: greedyTable <= 1 | ||
})), (greedyTable && list_1.default.jp2zh(char, { | ||
safe: greedyTable <= 1 | ||
})), (greedyTable > 1 && zh_table_greedy_1.greedyTableCharArray(char))); | ||
/* | ||
if (!skip || skip.indexOf(jt) == -1) | ||
{ | ||
a = a.concat(...cn(jt)); | ||
} | ||
if (!skip || skip.indexOf(js) == -1) | ||
{ | ||
a = a.concat(...tw(js)); | ||
} | ||
if (zhtw_convert.table_jp[char]) | ||
{ | ||
a = a.concat(jp(char)); | ||
} | ||
a = array_unique(a); | ||
a.sort(); | ||
*/ | ||
return a; | ||
} | ||
exports.auto = auto; | ||
exports._get = exports.libTable = void 0; | ||
const zh_table_alias_1 = __importDefault(require("@lazy-cjk/zh-table-alias")); | ||
exports.libTable = zh_table_alias_1.default; | ||
const util_1 = require("@lazy-cjk/zh-table-list/lib/util"); | ||
Object.defineProperty(exports, "_get", { enumerable: true, get: function () { return util_1._get; } }); | ||
__exportStar(require("@lazy-cjk/zh-table-list/lib/types"), exports); | ||
__exportStar(require("@lazy-cjk/zh-table-list"), exports); | ||
exports.default = exports; | ||
//# sourceMappingURL=index.js.map |
/** | ||
* Created by user on 2018/6/10/010. | ||
*/ | ||
import { IOptions as IOptionsZhTable } from './index'; | ||
import { IOptions as IOptionsCjkConv } from '../convert'; | ||
export declare type IOptions = { | ||
optionsZhTable?: IOptionsZhTable; | ||
skip?: any; | ||
lang?: 'cn' | 'jp' | 'auto' | string; | ||
}; | ||
/** | ||
* | ||
* @example | ||
* ``` | ||
* charTableList('司马') | ||
* // => [ [ '司' ], [ '馬', '马' ] ] | ||
* ``` | ||
*/ | ||
export declare function charTableList(text: string, options?: IOptions): string[][]; | ||
/** | ||
* | ||
* @example | ||
* textList('司马') | ||
* // => [ '司馬', '司马' ] | ||
*/ | ||
export declare function textList(text: string, options?: IOptions): string[]; | ||
/** | ||
* @example | ||
* arrCjk(['司马', '上官', '欧阳', '夏侯']) | ||
* // => [ '司马', '上官', '欧阳', '夏侯', '司馬', '歐陽', '欧陽' ] | ||
*/ | ||
export declare function arrCjk(arr: string[], options?: IOptionsCjkConv): string[]; | ||
/** | ||
* 用來標準化字串 作為排序用 | ||
*/ | ||
export declare function slugify(input: string, options?: IOptions, unsafe2?: boolean): string; | ||
/** | ||
* 用來標準化字串 作為排序用 | ||
*/ | ||
export declare function slugify(input: string, unsafe2?: boolean): string; | ||
declare const _default: typeof import("./list"); | ||
export default _default; | ||
export * from '@lazy-cjk/zh-table-list/list'; | ||
import m from '@lazy-cjk/zh-table-list/list'; | ||
export default m; |
@@ -5,2 +5,12 @@ "use strict"; | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -10,120 +20,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.slugify = exports.arrCjk = exports.textList = exports.charTableList = void 0; | ||
const index_1 = __importDefault(require("./index")); | ||
const convert_1 = require("../convert"); | ||
const jp_1 = require("../../jp"); | ||
const uni_string_1 = __importDefault(require("uni-string")); | ||
const zh_table_greedy_1 = require("@lazy-cjk/zh-table-greedy"); | ||
/** | ||
* | ||
* @example | ||
* ``` | ||
* charTableList('司马') | ||
* // => [ [ '司' ], [ '馬', '马' ] ] | ||
* ``` | ||
*/ | ||
function charTableList(text, options = {}) { | ||
let a = uni_string_1.default.split(text, ''); | ||
options = Object.assign({}, options); | ||
let optionsZhTable = Object.assign({ | ||
safe: true, | ||
skip: options.skip, | ||
}, options.optionsZhTable); | ||
let fn = index_1.default[options.lang || 'auto']; | ||
return a | ||
.reduce(function (a, c) { | ||
// @ts-ignore | ||
a.push(fn(c, optionsZhTable)); | ||
return a; | ||
}, []); | ||
} | ||
exports.charTableList = charTableList; | ||
/** | ||
* | ||
* @example | ||
* textList('司马') | ||
* // => [ '司馬', '司马' ] | ||
*/ | ||
function textList(text, options = {}) { | ||
let aa = []; | ||
let arr = charTableList(text, options); | ||
if (arr.length <= 1) { | ||
if (Array.isArray(arr[0])) { | ||
// @ts-ignore | ||
arr = arr[0]; | ||
} | ||
// @ts-ignore | ||
return arr; | ||
} | ||
arr | ||
.forEach(function (v, index, arr) { | ||
f(v, '', index, arr); | ||
}); | ||
function f(v, str = '', index, arr, depth = 0) { | ||
return v.reduce(function (a, c) { | ||
let s = str + c; | ||
let i = index + 1; | ||
if (i < arr.length) { | ||
let r = f(arr[i], s, i, arr, depth + 1); | ||
} | ||
else if ((depth + 1) == arr.length) { | ||
//console.log(777, s, [str, c], index, depth); | ||
aa.push(s); | ||
} | ||
return a; | ||
}, []); | ||
} | ||
aa.sort(); | ||
return aa; | ||
} | ||
exports.textList = textList; | ||
/** | ||
* @example | ||
* arrCjk(['司马', '上官', '欧阳', '夏侯']) | ||
* // => [ '司马', '上官', '欧阳', '夏侯', '司馬', '歐陽', '欧陽' ] | ||
*/ | ||
function arrCjk(arr, options = {}) { | ||
return arr | ||
// @ts-ignore | ||
.concat(arr.map(w(jp_1.cjk2zht))) | ||
// @ts-ignore | ||
.concat(arr.map(w(convert_1.cn2tw))) | ||
// @ts-ignore | ||
.concat(arr.map(w(jp_1.cjk2zhs))) | ||
// @ts-ignore | ||
.concat(arr.map(w(jp_1.cjk2jp))) | ||
.filter(function (value, index, array) { | ||
return array.indexOf(value) == index; | ||
}); | ||
function w(fn, ...argv) { | ||
return function (s) { | ||
return fn(s, options); | ||
}; | ||
} | ||
} | ||
exports.arrCjk = arrCjk; | ||
function slugify(input, options = {}, unsafe2) { | ||
if (typeof options === 'boolean') { | ||
[unsafe2, options] = [options, {}]; | ||
} | ||
options = (options || {}); | ||
options = { | ||
...options, | ||
optionsZhTable: { | ||
safe: false, | ||
greedyTable: true, | ||
...options.optionsZhTable, | ||
}, | ||
}; | ||
let k = unsafe2 ? zh_table_greedy_1.greedyTableReplace(input) : input; | ||
let arr = charTableList(k, options); | ||
return arr | ||
.reduce(function (s, a) { | ||
s.push(a[0]); | ||
return s; | ||
}, []) | ||
.join(''); | ||
} | ||
exports.slugify = slugify; | ||
exports.default = exports; | ||
__exportStar(require("@lazy-cjk/zh-table-list/list"), exports); | ||
const list_1 = __importDefault(require("@lazy-cjk/zh-table-list/list")); | ||
exports.default = list_1.default; | ||
//# sourceMappingURL=list.js.map |
@@ -1,33 +0,9 @@ | ||
/** | ||
* Created by user on 2018/2/17/017. | ||
*/ | ||
import { IOptions } from '../convert/core'; | ||
export declare let _table_tw: { | ||
readonly 罗: "羅"; | ||
readonly 恶: "惡"; | ||
readonly 苏: "蘇"; | ||
readonly 馆: "館"; | ||
}; | ||
/** | ||
* 此表內符合以下任意值時會觸發 | ||
*/ | ||
export declare const table_plus: Record<"絲" | "丝" | "氷" | "館" | "馆" | "鶏" | "雞" | "鸡" | "殻" | "壳" | "槍" | "枪" | "髪" | "髮" | "罵" | "骂" | "駄" | "馱" | "驮" | "歴" | "歷" | "暦" | "曆" | "錬" | "鍊" | "炼" | "蓋" | "盖" | "晩" | "晚" | "恒" | "恆" | "準" | "傑" | "杰" | "圏" | "圈" | "煙" | "烟" | "苏" | "並" | "并" | "鹹" | "咸" | "踪" | "蹤" | "秘" | "祕" | "黙" | "默" | "圧" | "壓" | "压" | "凄" | "淒" | "悽" | "穀" | "鶫" | "鶇" | "鸫" | "効" | "效" | "揷" | "插" | "賎" | "箋" | "笺" | "糸" | "余" | "餘" | "券" | "卷" | "為" | "为" | "偽" | "鳥" | "鸟" | "尋" | "寻" | "復" | "复" | "殼" | "視" | "视" | "証" | "證" | "证" | "閑" | "閒" | "闲" | "塗" | "涂" | "話" | "话" | "裏" | "裡" | "里" | "禍" | "祸" | "網" | "网" | "阁" | "憂" | "盤" | "盘" | "範" | "范" | "線" | "线" | "衛" | "卫" | "衝" | "冲" | "複" | "諸" | "诸" | "樸" | "朴" | "諮" | "谘" | "獲" | "获" | "鍾" | "钟" | "鍛" | "锻" | "穫" | "鑑" | "鉴" | "両" | "兩" | "两" | "亀" | "龜" | "龟" | "亜" | "会" | "會" | "倶" | "俱" | "内" | "內" | "処" | "處" | "处" | "剣" | "劍" | "剑" | "労" | "勞" | "劳" | "勲" | "勳" | "勋" | "単" | "單" | "单" | "参" | "參" | "収" | "收" | "啓" | "啟" | "启" | "営" | "団" | "團" | "团" | "国" | "國" | "壊" | "壞" | "坏" | "姉" | "姐" | "姫" | "姬" | "娯" | "嬢" | "孃" | "実" | "實" | "实" | "対" | "對" | "对" | "尽" | "盡" | "帯" | "廃" | "廢" | "废" | "貳" | "贰" | "弐" | "徴" | "徵" | "悪" | "懐" | "戦" | "戰" | "战" | "拠" | "據" | "据" | "拡" | "撃" | "擊" | "击" | "暁" | "曉" | "晓" | "査" | "桜" | "櫻" | "樱" | "楽" | "樂" | "乐" | "権" | "權" | "权" | "歓" | "歡" | "欢" | "歳" | "歲" | "岁" | "気" | "氣" | "气" | "浜" | "濱" | "滨" | "涙" | "淚" | "泪" | "済" | "濟" | "济" | "渓" | "溪" | "焔" | "焰" | "焼" | "犠" | "犧" | "牺" | "産" | "穂" | "穗" | "経" | "經" | "经" | "絵" | "絶" | "绝" | "継" | "繼" | "继" | "緑" | "綠" | "绿" | "繊" | "纖" | "纤" | "聴" | "舗" | "舖" | "铺" | "蔵" | "薬" | "藥" | "药" | "覇" | "霸" | "覧" | "観" | "觀" | "观" | "賛" | "贊" | "赞" | "辺" | "邊" | "边" | "郷" | "鄉" | "乡" | "釈" | "鉄" | "鐵" | "铁" | "銭" | "鋭" | "锐" | "録" | "錄" | "录" | "閲" | "闘" | "鬥" | "険" | "險" | "险" | "隷" | "隶" | "雑" | "霊" | "靈" | "灵" | "顔" | "顏" | "颜" | "験" | "驗" | "验" | "鬪" | "鷄" | "黒" | "黑" | "絕" | "蘇" | "隸" | "挿" | "凶" | "尨" | "兇" | "痴" | "茲" | "凈" | "剗" | "勛" | "廄" | "敘" | "噸" | "吒" | "啞" | "嚙" | "壺" | "爾" | "嘗" | "嶮" | "輓" | "棲" | "慄" | "竈" | "煉" | "鹼" | "蕩" | "薩" | "託" | "跡" | "鑒" | "鏟" | "鋪" | "麼" | "亘" | "伙" | "布" | "馀" | "家" | "净" | "刬" | "咤" | "哑" | "尝" | "吨" | "啮" | "向" | "墙" | "壶" | "崄" | "厩" | "栗" | "折" | "叙" | "栖" | "污" | "沉" | "凌" | "卤" | "沈" | "尔" | "杯" | "硷" | "御" | "灶" | "绷" | "缰" | "兹" | "荡" | "姜" | "萨" | "讬" | "赝" | "迹" | "挽" | "周" | "游" | "锈" | "铲" | "暗" | "郁" | "鳄" | "霉" | "於" | "淨" | "滷" | "齧" | "牆" | "扎" | "捻" | "檐" | "涌" | "瓮" | "綫" | "綳" | "繮" | "艸" | "贋" | "跖" | "鐘" | "銳" | "銹" | "鱷" | "麵" | "痲" | "藉" | "餵" | "砲" | "佈" | "繫" | "樑" | "餧" | "暱" | "汙" | "遊" | "夥" | "淩" | "紮" | "癡" | "薑" | "撚" | "黴" | "欲" | "慾" | "讚" | "菸" | "燻" | "熏" | "籲" | "龥" | "蹠" | "剷" | "劈" | "擗" | "核" | "覈" | "脣" | "唇" | "升" | "昇" | "磐" | "谿" | "嵠" | "祐" | "佑" | "罋" | "甕" | "闇" | "痺" | "痹" | "雇" | "僱" | "週" | "簷" | "湧" | "傢" | "亙" | "洩" | "泄" | "剿" | "勦" | "搾" | "榨" | "獃" | "盃" | "牋" | "竝" | "碱" | "凃" | "昵" | "梁" | "煅" | "炮" | "藤" | "缐" | "嘻" | "锺" | "𫗭" | "咨" | "痳" | "喂" | "像" | "象" | "氹" | "凼" | "狵" | "沙" | "你" | "呆" | "嬉" | "托" | "囯" | "喻" | "䇳" | "繋" | "囌" | "劵" | "鬭" | "麪" | "麺" | "讃" | "儘" | "他" | "她" | "廻" | "迴" | "鹵" | "砂" | "𫔀" | "籐" | "籘" | "妳" | "裸" | "嚮" | "玆" | "糓" | "䋄" | "䋞" | "刴" | "剁" | "剳" | "箚" | "鬱" | "喩" | "唖" | "鐡" | "韁" | "庅" | "麽" | "併" | "𠀤" | "沖" | "劎" | "劒" | "剱" | "劔" | "僞" | "兎" | "兔" | "坯" | "館" | "舘" | "𫠓" | "視" | "眎" | "諸" | "𡬶" | "㑹" | "䛡" | "閤" | "蔘" | "駡" | "鏽" | "䭾" | "蕯" | "騐" | "鄕" | "鄊" | "勉" | "勉" | "縴" | "寔" | "扵" | "䖏" | "瞪" | "瞠" | "眙" | "肢" | "胑" | "肉" | "宍" | "𠕎" | "𢝊" | "𢚧" | "𢟜" | "懮" | "𨗫" | "鎗" | "悠" | "滺" | "壷" | "葢" | "蹟" | "癒" | "瘉" | "邉" | "凖" | "衞" | "躶" | "𪚧" | "𪚿" | "𠃾" | "草" | "汚" | "禦" | "犇" | "奔" | "葁" | "覌" | "啔" | "廐" | "廏" | "𫔮" | "葯" | "𣛙" | "貮" | "𢎐" | "二" | "𪘂" | "囓" | "噛" | "摺" | "踨" | "爲" | "繃" | "敍" | "盪" | "墻" | "尓" | "廸" | "迪" | "耤" | "粽" | "糉" | "糭" | "曏" | "鰐" | "炭" | "碳" | "姊" | "𠞰" | "禍" | "侮" | "侮" | "嚐" | "贗" | "呪" | "咒" | "詋", string[]>; | ||
/** | ||
* 此表內只有符合 KEY 值時才會觸發 | ||
*/ | ||
export declare const table_jp: Record<"絲" | "丝" | "氷" | "館" | "馆" | "画" | "鶏" | "雞" | "鸡" | "殻" | "壳" | "槍" | "枪" | "髪" | "髮" | "罵" | "骂" | "駄" | "馱" | "驮" | "歴" | "歷" | "历" | "暦" | "曆" | "錬" | "鍊" | "炼" | "蓋" | "盖" | "晩" | "晚" | "恒" | "恆" | "准" | "準" | "傑" | "杰" | "圏" | "圈" | "煙" | "烟" | "甦" | "苏" | "並" | "并" | "鹹" | "咸" | "踪" | "蹤" | "秘" | "祕" | "黙" | "默" | "圧" | "壓" | "压" | "凄" | "淒" | "悽" | "穀" | "鶫" | "鶇" | "鸫" | "効" | "效" | "揷" | "插" | "賎" | "箋" | "笺" | "糸" | "余" | "餘" | "券" | "卷" | "為" | "为" | "乾" | "干" | "偽" | "鳥" | "鸟" | "尋" | "寻" | "復" | "复" | "殼" | "視" | "视" | "証" | "證" | "证" | "閑" | "閒" | "闲" | "塗" | "涂" | "幹" | "話" | "话" | "裏" | "裡" | "里" | "禍" | "祸" | "網" | "网" | "阁" | "憂" | "忧" | "盤" | "盘" | "範" | "范" | "練" | "练" | "線" | "线" | "衛" | "卫" | "衝" | "冲" | "複" | "諸" | "诸" | "樸" | "朴" | "諮" | "谘" | "獲" | "获" | "鍾" | "钟" | "鍛" | "锻" | "穫" | "罗" | "鑑" | "鉴" | "両" | "兩" | "两" | "亀" | "龜" | "龟" | "亜" | "会" | "會" | "倶" | "俱" | "内" | "內" | "処" | "處" | "处" | "剣" | "劍" | "剑" | "労" | "勞" | "劳" | "勲" | "勳" | "勋" | "単" | "單" | "单" | "参" | "參" | "収" | "收" | "啓" | "啟" | "启" | "営" | "団" | "團" | "团" | "図" | "国" | "國" | "壊" | "壞" | "坏" | "姉" | "姐" | "姫" | "姬" | "娯" | "嬢" | "孃" | "実" | "實" | "实" | "対" | "對" | "对" | "尽" | "盡" | "巻" | "帯" | "廃" | "廢" | "废" | "貳" | "贰" | "弐" | "当" | "徴" | "徵" | "悪" | "恶" | "懐" | "戦" | "戰" | "战" | "拠" | "據" | "据" | "拡" | "撃" | "擊" | "击" | "暁" | "曉" | "晓" | "査" | "桜" | "櫻" | "樱" | "楽" | "樂" | "乐" | "権" | "權" | "权" | "歓" | "歡" | "欢" | "歳" | "歲" | "岁" | "気" | "氣" | "气" | "浜" | "濱" | "滨" | "涙" | "淚" | "泪" | "済" | "濟" | "济" | "渓" | "溪" | "焔" | "焰" | "焼" | "犠" | "犧" | "牺" | "産" | "发" | "穂" | "穗" | "経" | "經" | "经" | "絵" | "絶" | "绝" | "継" | "繼" | "继" | "緑" | "綠" | "绿" | "繊" | "纖" | "纤" | "聴" | "脏" | "舗" | "舖" | "铺" | "蔵" | "薬" | "藥" | "药" | "覇" | "霸" | "覧" | "観" | "觀" | "观" | "賛" | "贊" | "赞" | "辺" | "邊" | "边" | "郷" | "鄉" | "乡" | "釈" | "鉄" | "鐵" | "铁" | "銭" | "鋭" | "锐" | "録" | "錄" | "录" | "閲" | "闘" | "鬥" | "険" | "險" | "险" | "隷" | "隶" | "雑" | "霊" | "靈" | "灵" | "顔" | "顏" | "颜" | "験" | "驗" | "验" | "鬪" | "鷄" | "黒" | "黑" | "絕" | "蘇" | "隸" | "挿" | "凶" | "尨" | "兇" | "台" | "痴" | "と" | "茲" | "凈" | "剗" | "勛" | "廄" | "敘" | "噸" | "吒" | "啞" | "嚙" | "壺" | "爾" | "嘗" | "嶮" | "輓" | "棲" | "慄" | "瀏" | "竈" | "煉" | "鹼" | "蕩" | "薩" | "託" | "跡" | "鑒" | "鏟" | "鋪" | "麼" | "亘" | "伙" | "布" | "馀" | "家" | "净" | "刬" | "汇" | "吁" | "咤" | "哑" | "尝" | "吨" | "啮" | "向" | "采" | "墙" | "壶" | "崄" | "厩" | "栗" | "折" | "叙" | "栖" | "污" | "沉" | "凌" | "卤" | "沈" | "浏" | "尔" | "杯" | "硷" | "御" | "灶" | "绷" | "缰" | "修" | "兹" | "荡" | "姜" | "萨" | "讬" | "赝" | "迹" | "挽" | "周" | "游" | "锈" | "铲" | "暗" | "辟" | "郁" | "鳄" | "面" | "霉" | "於" | "淨" | "滷" | "唿" | "齧" | "囉" | "嗬" | "牆" | "扎" | "捻" | "檐" | "涌" | "犟" | "瓮" | "綫" | "綳" | "繮" | "艸" | "贋" | "跖" | "鐘" | "銳" | "銹" | "鱷" | "麵" | "痲" | "藉" | "餵" | "砲" | "佈" | "繫" | "樑" | "餧" | "暱" | "汙" | "遊" | "夥" | "淩" | "紮" | "癡" | "薑" | "撚" | "黴" | "欲" | "慾" | "讚" | "菸" | "捲" | "燻" | "熏" | "籲" | "龥" | "蹠" | "剷" | "劈" | "擗" | "核" | "覈" | "脣" | "唇" | "升" | "昇" | "磐" | "谿" | "嵠" | "祐" | "佑" | "媮" | "罋" | "甕" | "闇" | "痺" | "痹" | "雇" | "僱" | "週" | "闢" | "簷" | "湧" | "傢" | "亙" | "洩" | "泄" | "剿" | "勦" | "搾" | "榨" | "獃" | "盃" | "牋" | "竝" | "啰" | "碱" | "凃" | "昵" | "梁" | "煅" | "炮" | "藤" | "缐" | "嘻" | "锺" | "𫗭" | "咨" | "痳" | "喂" | "像" | "象" | "氹" | "凼" | "狵" | "の" | "沙" | "你" | "呆" | "嬉" | "托" | "囯" | "喻" | "揹" | "䇳" | "繋" | "覆" | "囌" | "彩" | "劵" | "鬭" | "乹" | "亁" | "麪" | "麺" | "讃" | "侭" | "儘" | "他" | "她" | "炰" | "廻" | "迴" | "避" | "鹵" | "儓" | "檯" | "砂" | "𫔀" | "籐" | "籘" | "妳" | "裸" | "嚮" | "玆" | "糓" | "版" | "䋄" | "䋞" | "刴" | "剁" | "剳" | "箚" | "鬱" | "喩" | "唖" | "鐡" | "韁" | "鬚" | "庅" | "麽" | "併" | "倂" | "幷" | "𠀤" | "沖" | "呻" | "袮" | "𠩺" | "劎" | "劒" | "剱" | "劔" | "僞" | "兎" | "兔" | "坯" | "館" | "舘" | "𫠓" | "視" | "眎" | "諸" | "𡬶" | "㑹" | "䛡" | "閤" | "蔘" | "駡" | "鏽" | "䭾" | "蕯" | "騐" | "鄕" | "鄊" | "勉" | "勉" | "縴" | "寔" | "扵" | "䖏" | "瞪" | "瞠" | "眙" | "肢" | "胑" | "肉" | "宍" | "𠕎" | "𢝊" | "𢚧" | "𢟜" | "懮" | "𨗫" | "鎗" | "悠" | "滺" | "壷" | "葢" | "蹟" | "癒" | "瘉" | "邉" | "凖" | "衞" | "躶" | "𪚧" | "𪚿" | "𠃾" | "草" | "汚" | "禦" | "犇" | "奔" | "葁" | "覌" | "啔" | "廐" | "廏" | "𫔮" | "葯" | "𣛙" | "貮" | "𢎐" | "二" | "𪘂" | "囓" | "噛" | "摺" | "踨" | "爲" | "繃" | "敍" | "盪" | "墻" | "尓" | "廸" | "迪" | "耤" | "粽" | "糉" | "糭" | "曏" | "鰐" | "炭" | "碳" | "姊" | "𠞰" | "禍" | "侮" | "侮" | "嚐" | "贗" | "呪" | "咒" | "詋", string[]>; | ||
declare type IArrayOrReadonly<U> = U[] | readonly U[]; | ||
export declare function _uniqueTable<T extends Record<string, IArrayOrReadonly<string>>>(table_jp: T): T; | ||
export declare function _buildTablePlus<T extends string, U extends string>(table_plus: Record<T, IArrayOrReadonly<U>>): Record<U | T, string[]>; | ||
export declare function _mergeTable<T extends string, U extends string>(table_jp: Record<T, IArrayOrReadonly<string>>, table_plus: Record<U, IArrayOrReadonly<string>>): Record<U | T, string[]>; | ||
export interface ISimpleTable { | ||
[key: string]: string; | ||
} | ||
export declare let _table_cn: ISimpleTable; | ||
export declare function _update(target: ISimpleTable, source: ISimpleTable): ISimpleTable; | ||
export declare function _get(arr: string[], value: string | string[], ...values: Array<string | string[]>): string[]; | ||
export declare function jp(char: string, options?: IOptions): string[]; | ||
export declare function tw(char: string, options?: IOptions): string[]; | ||
export declare function cn(char: string, options?: IOptions): string[]; | ||
export { _table_tw } from "@lazy-cjk/zh-table-alias/lib/table/raw"; | ||
export * from '@lazy-cjk/zh-table-alias'; | ||
export * from '@lazy-cjk/zh-table-alias/lib/table'; | ||
export * from '@lazy-cjk/zh-table-alias/lib/util/table'; | ||
export * from "@lazy-cjk/zh-table-alias/lib/util/unique"; | ||
export * from '@lazy-cjk/zh-table-alias/lib/util/core'; | ||
export * from '@lazy-cjk/zh-table-alias/lib/types'; | ||
declare const _default: typeof import("./table"); | ||
export default _default; |
"use strict"; | ||
/** | ||
* Created by user on 2018/2/17/017. | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.cn = exports.tw = exports.jp = exports._get = exports._update = exports._table_cn = exports._mergeTable = exports._buildTablePlus = exports._uniqueTable = exports.table_jp = exports.table_plus = exports._table_tw = void 0; | ||
const index_1 = require("../convert/index"); | ||
const array_hyper_unique_1 = require("array-hyper-unique"); | ||
const deepmerge_plus_1 = __importDefault(require("deepmerge-plus")); | ||
const list_1 = require("../../jp/list"); | ||
exports._table_tw = { | ||
'罗': '羅', | ||
'恶': '惡', | ||
'苏': '蘇', | ||
'馆': '館', | ||
}; | ||
/** | ||
* 此表內只有符合 KEY 值時才會觸發 | ||
*/ | ||
let table_jp_core = { | ||
'の': [ | ||
'の', | ||
'之', | ||
'的', | ||
], | ||
'と': [ | ||
'と', | ||
'與', | ||
'与', | ||
], | ||
'画': [ | ||
'划', | ||
'画', | ||
'劃', | ||
'畫', | ||
], | ||
'闘': [ | ||
'斗', | ||
], | ||
'鬥': [ | ||
'斗', | ||
], | ||
'鬭': [ | ||
'斗', | ||
], | ||
'鬪': [ | ||
'斗', | ||
], | ||
'闇': [ | ||
'暗', | ||
], | ||
'図': [ | ||
'図', | ||
'圖', | ||
'图', | ||
], | ||
'当': [ | ||
'当', | ||
'噹', | ||
'當', | ||
'儅', | ||
], | ||
'閤': [ | ||
'合', | ||
], | ||
'阁': [ | ||
'合', | ||
], | ||
'罗': [ | ||
'羅', | ||
'罗', | ||
'儸', | ||
'㑩', | ||
'囉', | ||
'啰', | ||
], | ||
'干': [ | ||
'幹', | ||
'乾', | ||
'干', | ||
], | ||
'幹': [ | ||
'幹', | ||
'干', | ||
], | ||
'乾': [ | ||
'干', | ||
'乾', | ||
'亁', | ||
'乹', | ||
], | ||
'亁': [ | ||
'乾', | ||
'亁', | ||
'乹', | ||
], | ||
'乹': [ | ||
'乾', | ||
'亁', | ||
'乹', | ||
], | ||
'历': [ | ||
'历', | ||
'歴', | ||
'歷', | ||
'暦', | ||
'曆', | ||
], | ||
'歴': [ | ||
'历', | ||
], | ||
'歷': [ | ||
'历', | ||
], | ||
'暦': [ | ||
'历', | ||
], | ||
'曆': [ | ||
'历', | ||
], | ||
'呻': [ | ||
'呻', | ||
'申', | ||
], | ||
'覆': [ | ||
'覆', | ||
'复', | ||
], | ||
'复': [ | ||
'覆', | ||
], | ||
'勉': [ | ||
'免', | ||
], | ||
'勉': [ | ||
'免', | ||
], | ||
'甦': [ | ||
'甦', | ||
'蘇', | ||
'苏', | ||
], | ||
'忧': [ | ||
'憂', | ||
'優', | ||
], | ||
'鹹': [ | ||
'咸', | ||
'鹹', | ||
], | ||
'准': [ | ||
'準', | ||
'准', | ||
], | ||
'準': [ | ||
'準', | ||
'准', | ||
], | ||
'袮': [ | ||
'袮', | ||
// 並非異體字 但由於過度相似 容易錯誤 | ||
'祢', | ||
], | ||
'儘': [ | ||
'儘', | ||
'侭', | ||
], | ||
'侭': [ | ||
'儘', | ||
'侭', | ||
], | ||
'脏': [ | ||
'脏', | ||
'髒', | ||
'臟', | ||
], | ||
'发': [ | ||
'髮', | ||
'髪', | ||
'发', | ||
], | ||
'髮': [ | ||
'發', | ||
'发', | ||
], | ||
'慾': [ | ||
'慾', | ||
'欲', | ||
], | ||
'讚': [ | ||
'讃', | ||
'讚', | ||
'贊', | ||
'赞', | ||
'賛', | ||
], | ||
'冲': [ | ||
'冲', | ||
'沖', | ||
'衝', | ||
], | ||
'面': [ | ||
'麵', | ||
'麪', | ||
'麺', | ||
], | ||
'鬚': [ | ||
'鬚', | ||
'須', | ||
'须', | ||
], | ||
'揹': [ | ||
'揹', | ||
'背', | ||
], | ||
'捲': [ | ||
'捲', | ||
'卷', | ||
'巻', | ||
], | ||
'卷': [ | ||
'捲', | ||
'卷', | ||
'巻', | ||
'劵', | ||
'券', | ||
], | ||
'巻': [ | ||
'捲', | ||
'卷', | ||
'巻', | ||
'劵', | ||
'券', | ||
], | ||
'苏': [ | ||
'苏', | ||
'蘇', | ||
'甦', | ||
], | ||
'瀏': [ | ||
'瀏', | ||
'浏', | ||
'刘', | ||
], | ||
'浏': [ | ||
'瀏', | ||
'浏', | ||
'刘', | ||
], | ||
'吁': [ | ||
'籲', | ||
//'龥', | ||
'吁', | ||
], | ||
'囉': [ | ||
'囉', | ||
'啰', | ||
'罗', | ||
'羅', | ||
], | ||
'啰': [ | ||
'囉', | ||
'啰', | ||
'罗', | ||
'羅', | ||
], | ||
'修': [ | ||
'修', | ||
'俢', | ||
], | ||
'犟': [ | ||
'犟', | ||
'強', | ||
'强', | ||
], | ||
'嗬': [ | ||
'嗬', | ||
'呵', | ||
], | ||
'唿': [ | ||
'唿', | ||
'呼', | ||
], | ||
'媮': [ | ||
'媮', | ||
'偷', | ||
], | ||
'采': [ | ||
'采', | ||
'採', | ||
], | ||
'彩': [ | ||
'彩', | ||
'采', | ||
], | ||
'𠩺': [ | ||
'𠩺', | ||
'釐', | ||
], | ||
/* | ||
'甚': [ | ||
'甚', | ||
'什', | ||
], | ||
*/ | ||
'恶': [ | ||
'恶', | ||
'噁', | ||
'惡', | ||
], | ||
'炰': [ | ||
'炰', | ||
'炮', | ||
], | ||
'辟': [ | ||
'辟', | ||
'闢', | ||
'避', | ||
], | ||
'避': [ | ||
'辟', | ||
'避', | ||
], | ||
'闢': [ | ||
'辟', | ||
'闢', | ||
], | ||
'滷': [ | ||
'魯', | ||
'鲁', | ||
], | ||
'鹵': [ | ||
'魯', | ||
'鲁', | ||
], | ||
'卤': [ | ||
'魯', | ||
'鲁', | ||
], | ||
'儓': [ | ||
'儓', | ||
'檯', | ||
], | ||
'檯': [ | ||
'儓', | ||
'檯', | ||
], | ||
'台': [ | ||
'台', | ||
'檯', | ||
'臺', | ||
'颱', | ||
], | ||
'練': [ | ||
'炼', | ||
], | ||
'练': [ | ||
'炼', | ||
], | ||
'繫': [ | ||
'系', | ||
], | ||
'繋': [ | ||
'系', | ||
], | ||
'糓': [ | ||
'谷', | ||
], | ||
'穀': [ | ||
'谷', | ||
], | ||
'版': [ | ||
'板', | ||
], | ||
'祕': [ | ||
'密', | ||
], | ||
'秘': [ | ||
'密', | ||
], | ||
'汇': [ | ||
'彙', | ||
'匯', | ||
], | ||
'倂': [ | ||
'倂', | ||
'併', | ||
], | ||
'併': [ | ||
'倂', | ||
'併', | ||
], | ||
'幷': [ | ||
'并', | ||
], | ||
'并': [ | ||
'幷', | ||
], | ||
}; | ||
/** | ||
* 此表內符合以下任意值時會觸發 | ||
*/ | ||
let table_plus_core = { | ||
'劍': [ | ||
'劍', | ||
'剑', | ||
'剣', | ||
'劎', | ||
'劒', | ||
'剱', | ||
'劔', | ||
], | ||
'砲': [ | ||
'砲', | ||
'炮', | ||
], | ||
'偽': [ | ||
'偽', | ||
'僞', | ||
], | ||
'內': [ | ||
'內', | ||
'内', | ||
], | ||
'鬥': [ | ||
'鬭', | ||
'鬥', | ||
'闘', | ||
'鬪', | ||
], | ||
'鶏': [ | ||
'鶏', | ||
'鷄', | ||
'雞', | ||
'鸡', | ||
], | ||
'兎': [ | ||
'兎', | ||
'兔', | ||
], | ||
'坏': [ | ||
'坯', | ||
'坏', | ||
"壊", | ||
"壞", | ||
], | ||
'殻': [ | ||
'殻', | ||
'殼', | ||
'壳', | ||
], | ||
'像': [ | ||
'像', | ||
'象', | ||
], | ||
'蘇': [ | ||
'苏', | ||
'蘇', | ||
'囌', | ||
], | ||
'館': [ | ||
'館', | ||
'館', | ||
'舘', | ||
'馆', | ||
], | ||
'鳥': [ | ||
'鳥', | ||
'鸟', | ||
'𫠓', | ||
], | ||
'視': [ | ||
'視', | ||
'視', | ||
'视', | ||
'眎', | ||
], | ||
'険': [ | ||
'険', | ||
'險', | ||
'险', | ||
'嶮', | ||
'崄', | ||
], | ||
'絶': [ | ||
'絶', | ||
'絕', | ||
'绝', | ||
], | ||
'鉄': [ | ||
'鉄', | ||
'鐵', | ||
'铁', | ||
'鐡', | ||
], | ||
'諸': [ | ||
'諸', | ||
'諸', | ||
'诸', | ||
], | ||
'尋': [ | ||
'尋', | ||
'寻', | ||
'𡬶', | ||
], | ||
'裡': [ | ||
'裡', | ||
'裏', | ||
'里', | ||
], | ||
'鑑': [ | ||
'鑑', | ||
'鉴', | ||
'鑒', | ||
], | ||
'麵': [ | ||
'麵', | ||
'麪', | ||
'麺', | ||
], | ||
'歲': [ | ||
'歲', | ||
'歳', | ||
'岁', | ||
], | ||
// https://zh.wikipedia.org/wiki/%E9%8D%BE%E5%A7%93 | ||
'鐘': [ | ||
'鐘', | ||
'鍾', | ||
'钟', | ||
'锺', | ||
], | ||
'會': [ | ||
'會', | ||
'会', | ||
'㑹', | ||
], | ||
'塗': [ | ||
'塗', | ||
'凃', | ||
'涂', | ||
], | ||
'髮': [ | ||
'髮', | ||
'髪', | ||
], | ||
'話': [ | ||
'話', | ||
'话', | ||
'䛡', | ||
], | ||
'閤': [ | ||
'閤', | ||
'阁', | ||
], | ||
'蔘': [ | ||
'蔘', | ||
'參', | ||
'参', | ||
], | ||
'労': [ | ||
'労', | ||
'勞', | ||
'劳', | ||
], | ||
'国': [ | ||
'国', | ||
'囯', | ||
'國', | ||
], | ||
'罵': [ | ||
'罵', | ||
'骂', | ||
'駡', | ||
], | ||
'対': [ | ||
'対', | ||
'對', | ||
'对', | ||
], | ||
'鏽': [ | ||
'鏽', | ||
'銹', | ||
'锈', | ||
], | ||
'駄': [ | ||
'駄', | ||
'䭾', | ||
'馱', | ||
'驮', | ||
], | ||
'薩': [ | ||
'薩', | ||
'萨', | ||
'蕯', | ||
], | ||
'単': [ | ||
'単', | ||
'單', | ||
'单', | ||
], | ||
'継': [ | ||
'継', | ||
'繼', | ||
'继', | ||
], | ||
'驗': [ | ||
'驗', | ||
'验', | ||
'騐', | ||
'験', | ||
], | ||
'歴': [ | ||
'歴', | ||
'歷', | ||
], | ||
'暦': [ | ||
//'歴', | ||
//'歷', | ||
'暦', | ||
'曆', | ||
], | ||
'団': [ | ||
'团', | ||
'団', | ||
'團', | ||
], | ||
'麼': [ | ||
'麼', | ||
'麽', | ||
'庅', | ||
], | ||
'戰': [ | ||
'戦', | ||
'戰', | ||
'战', | ||
], | ||
'乡': [ | ||
'郷', | ||
'鄕', | ||
'鄉', | ||
'鄊', | ||
'乡', | ||
], | ||
'勉': [ | ||
'勉', | ||
'勉', | ||
], | ||
'餘': [ | ||
'餘', | ||
'馀', | ||
'余', | ||
], | ||
'網': [ | ||
'網', | ||
'䋄', | ||
'䋞', | ||
'网', | ||
], | ||
'託': [ | ||
'託', | ||
'讬', | ||
//'侂', | ||
'托', | ||
], | ||
'纖': [ | ||
'纖', | ||
'纤', | ||
'縴', | ||
'繊', | ||
], | ||
'鍊': [ | ||
'鍊', | ||
'錬', | ||
'𫔀', | ||
'炼', | ||
'煉', | ||
], | ||
'擊': [ | ||
'撃', | ||
'擊', | ||
'击', | ||
], | ||
'實': [ | ||
'實', | ||
'実', | ||
'实', | ||
'寔', | ||
], | ||
'於': [ | ||
'於', | ||
'扵', | ||
], | ||
'證': [ | ||
'證', | ||
'証', | ||
'证', | ||
], | ||
'據': [ | ||
'據', | ||
'据', | ||
'拠', | ||
], | ||
'處': [ | ||
'處', | ||
'处', | ||
'䖏', | ||
'処', | ||
], | ||
'瞪': [ | ||
'瞪', | ||
'瞠', | ||
'眙', | ||
], | ||
'肢': [ | ||
'肢', | ||
'胑', | ||
], | ||
'肉': [ | ||
'肉', | ||
'宍', | ||
'𠕎', | ||
], | ||
'憂': [ | ||
'憂', | ||
'𢝊', | ||
'𢚧', | ||
'𢟜', | ||
'懮', | ||
'𨗫', | ||
], | ||
'繫': [ | ||
'繫', | ||
//'系', | ||
'繋', | ||
], | ||
'廻': [ | ||
'廻', | ||
'迴', | ||
], | ||
'録': [ | ||
'録', | ||
'錄', | ||
'录', | ||
], | ||
'鎗': [ | ||
'鎗', | ||
'槍', | ||
'枪', | ||
], | ||
'悠': [ | ||
'悠', | ||
'滺', | ||
], | ||
'壶': [ | ||
'壶', | ||
'壺', | ||
'壷', | ||
], | ||
'茲': [ | ||
'茲', | ||
'兹', | ||
'玆', | ||
], | ||
'蓋': [ | ||
'蓋', | ||
'盖', | ||
'葢', | ||
], | ||
'蹟': [ | ||
'蹟', | ||
'跡', | ||
'迹', | ||
], | ||
'癒': [ | ||
'癒', | ||
'瘉', | ||
], | ||
'辺': [ | ||
'辺', | ||
'邊', | ||
'边', | ||
'邉', | ||
], | ||
'準': [ | ||
'準', | ||
'凖', | ||
], | ||
'衛': [ | ||
'衛', | ||
'衞', | ||
'卫', | ||
], | ||
'晚': [ | ||
'晚', | ||
'晩', | ||
], | ||
'裸': [ | ||
'裸', | ||
'躶', | ||
], | ||
'亀': [ | ||
'亀', | ||
'龜', | ||
'龟', | ||
'𪚧', | ||
'𪚿', | ||
'𠃾', | ||
], | ||
'凼': [ | ||
'凼', | ||
'氹', | ||
], | ||
'艸': [ | ||
'艸', | ||
'草', | ||
], | ||
// '札': [ | ||
// '箚', | ||
// '剳', | ||
// ], | ||
'箚': [ | ||
'箚', | ||
'剳', | ||
], | ||
'复': [ | ||
'复', | ||
'復', | ||
'複', | ||
], | ||
'污': [ | ||
'污', | ||
'汙', | ||
'汚', | ||
], | ||
'伙': [ | ||
'伙', | ||
'夥', | ||
], | ||
'御': [ | ||
'御', | ||
'禦', | ||
], | ||
'鬱': [ | ||
'鬱', | ||
'郁', | ||
], | ||
'淩': [ | ||
'淩', | ||
'凌', | ||
], | ||
'紮': [ | ||
'紮', | ||
'扎', | ||
], | ||
'痴': [ | ||
'痴', | ||
'癡', | ||
], | ||
'栖': [ | ||
'栖', | ||
'棲', | ||
], | ||
'犇': [ | ||
'犇', | ||
'奔', | ||
], | ||
'範': [ | ||
'範', | ||
'范', | ||
], | ||
'薑': [ | ||
'薑', | ||
'姜', | ||
'葁', | ||
], | ||
'樸': [ | ||
'樸', | ||
'朴', | ||
], | ||
'諮': [ | ||
'諮', | ||
'谘', | ||
'咨', | ||
], | ||
'撚': [ | ||
'撚', | ||
'捻', | ||
], | ||
'喂': [ | ||
'喂', | ||
'餵', | ||
'餧', | ||
'𫗭', | ||
], | ||
'淨': [ | ||
'淨', | ||
'凈', | ||
'净', | ||
], | ||
'栗': [ | ||
'栗', | ||
'慄', | ||
], | ||
'挽': [ | ||
'挽', | ||
'輓', | ||
], | ||
'灶': [ | ||
'灶', | ||
'竈', | ||
], | ||
'線': [ | ||
'線', | ||
'缐', | ||
'綫', | ||
'线', | ||
], | ||
'盡': [ | ||
'盡', | ||
'尽', | ||
'儘', | ||
], | ||
'黴': [ | ||
'黴', | ||
'霉', | ||
], | ||
'周': [ | ||
'周', | ||
'週', | ||
], | ||
'並': [ | ||
'並', | ||
'并', | ||
'併', | ||
], | ||
'讚': [ | ||
'讚', | ||
'讃', | ||
], | ||
'観': [ | ||
'観', | ||
'觀', | ||
'观', | ||
'覌', | ||
], | ||
'遊': [ | ||
'遊', | ||
'游', | ||
], | ||
'启': [ | ||
'启', | ||
'啓', | ||
'啟', | ||
'啔', | ||
], | ||
'廄': [ | ||
'廄', | ||
'厩', | ||
'廐', | ||
'廏', | ||
], | ||
'氣': [ | ||
'気', | ||
'氣', | ||
'气', | ||
], | ||
'欲': [ | ||
'慾', | ||
'欲', | ||
], | ||
'傑': [ | ||
'傑', | ||
'杰', | ||
], | ||
'鍛': [ | ||
'鍛', | ||
'锻', | ||
'煅', | ||
], | ||
'徵': [ | ||
'徵', | ||
'徴', | ||
], | ||
'閒': [ | ||
'閒', | ||
'𫔮', | ||
'閑', | ||
'闲', | ||
], | ||
'贊': [ | ||
'贊', | ||
'赞', | ||
'賛', | ||
], | ||
'櫻': [ | ||
'櫻', | ||
'桜', | ||
'樱', | ||
], | ||
'尨': [ | ||
'尨', | ||
'狵', | ||
], | ||
'圈': [ | ||
'圈', | ||
'圏', | ||
], | ||
'凶': [ | ||
'凶', | ||
'兇', | ||
], | ||
'浜': [ | ||
'浜', | ||
'濱', | ||
'滨', | ||
], | ||
'煙': [ | ||
'煙', | ||
'烟', | ||
'菸', | ||
], | ||
'黒': [ | ||
'黒', | ||
'黑', | ||
], | ||
'樂': [ | ||
'樂', | ||
'乐', | ||
'楽', | ||
], | ||
'薬': [ | ||
'薬', | ||
'藥', | ||
'药', | ||
'葯', | ||
'𣛙', | ||
], | ||
'劵': [ | ||
'劵', | ||
'券', | ||
'卷', | ||
], | ||
'貳': [ | ||
'貳', | ||
'贰', | ||
'弐', | ||
'貮', | ||
'𢎐', | ||
'二', | ||
], | ||
'隷': [ | ||
'隷', | ||
'隸', | ||
'隶', | ||
], | ||
'姫': [ | ||
'姫', | ||
'姬', | ||
], | ||
'燻': [ | ||
'燻', | ||
'熏', | ||
], | ||
'籲': [ | ||
'籲', | ||
'龥', | ||
], | ||
'齧': [ | ||
'齧', | ||
'啮', | ||
'𪘂', | ||
'囓', | ||
'噛', | ||
'嚙', | ||
], | ||
'鹼': [ | ||
'鹼', | ||
'碱', | ||
'硷', | ||
], | ||
'咸': [ | ||
'咸', | ||
'鹹', | ||
], | ||
'穗': [ | ||
'穗', | ||
'穂', | ||
], | ||
'廢': [ | ||
'廢', | ||
'廃', | ||
'废', | ||
], | ||
'蹠': [ | ||
'蹠', | ||
'跖', | ||
], | ||
'吒': [ | ||
'吒', | ||
'咤', | ||
], | ||
'剷': [ | ||
'剷', | ||
'鏟', | ||
'铲', | ||
'刬', | ||
'剗', | ||
], | ||
'擗': [ | ||
'擗', | ||
'劈', | ||
], | ||
'核': [ | ||
'核', | ||
'覈', | ||
], | ||
'脣': [ | ||
'脣', | ||
'唇', | ||
'唇', | ||
], | ||
'升': [ | ||
'升', | ||
'昇', | ||
], | ||
'磐': [ | ||
'磐', | ||
'盤', | ||
'盘', | ||
], | ||
'溪': [ | ||
'溪', | ||
'渓', | ||
], | ||
'谿': [ | ||
'谿', | ||
'嵠', | ||
], | ||
'折': [ | ||
'折', | ||
'摺', | ||
], | ||
'祐': [ | ||
'祐', | ||
'佑', | ||
], | ||
'瓮': [ | ||
'瓮', | ||
'罋', | ||
'甕', | ||
], | ||
'蹤': [ | ||
'蹤', | ||
'踪', | ||
'踨', | ||
], | ||
'暗': [ | ||
'闇', | ||
'暗', | ||
], | ||
'昵': [ | ||
'昵', | ||
'暱', | ||
], | ||
'布': [ | ||
'布', | ||
'佈', | ||
], | ||
'為': [ | ||
'為', | ||
'为', | ||
'爲', | ||
], | ||
'綳': [ | ||
'綳', | ||
'繃', | ||
'绷', | ||
], | ||
'痺': [ | ||
'痺', | ||
'痹', | ||
], | ||
'痲': [ | ||
'痲', | ||
'痳', | ||
], | ||
'雇': [ | ||
'雇', | ||
'僱', | ||
], | ||
'敘': [ | ||
'敘', | ||
'叙', | ||
'敍', | ||
], | ||
'盪': [ | ||
'盪', | ||
'蕩', | ||
'荡', | ||
], | ||
'勛': [ | ||
'勛', | ||
'勳', | ||
'勋', | ||
'勲', | ||
], | ||
'祕': [ | ||
'祕', | ||
'秘', | ||
], | ||
'牆': [ | ||
'牆', | ||
'墙', | ||
'墻', | ||
], | ||
'爾': [ | ||
'爾', | ||
'尔', | ||
'尓', | ||
], | ||
'焰': [ | ||
'焰', | ||
'焔', | ||
], | ||
'默': [ | ||
'默', | ||
'黙', | ||
], | ||
'壓': [ | ||
'壓', | ||
'压', | ||
'圧', | ||
], | ||
'廸': [ | ||
'廸', | ||
'迪', | ||
], | ||
'曉': [ | ||
'曉', | ||
'晓', | ||
'暁', | ||
], | ||
'霸': [ | ||
'霸', | ||
'覇', | ||
], | ||
'霊': [ | ||
'霊', | ||
'靈', | ||
'灵', | ||
], | ||
'泪': [ | ||
'泪', | ||
'涙', | ||
'淚', | ||
], | ||
'牺': [ | ||
'牺', | ||
'犠', | ||
'犧', | ||
], | ||
'藉': [ | ||
'藉', | ||
'耤', | ||
], | ||
'噸': [ | ||
'噸', | ||
'吨', | ||
], | ||
'俱': [ | ||
'俱', | ||
'倶', | ||
], | ||
'粽': [ | ||
'粽', | ||
'糉', | ||
'糭', | ||
], | ||
'向': [ | ||
'向', | ||
'曏', | ||
'嚮', | ||
], | ||
'悽': [ | ||
'悽', | ||
'淒', | ||
'凄', | ||
], | ||
'鱷': [ | ||
'鱷', | ||
'鰐', | ||
'鳄', | ||
], | ||
'滷': [ | ||
'滷', | ||
'鹵', | ||
'卤', | ||
], | ||
'颜': [ | ||
'颜', | ||
'顏', | ||
'顔', | ||
], | ||
'衝': [ | ||
'衝', | ||
'沖', | ||
'冲', | ||
], | ||
'樑': [ | ||
'樑', | ||
'梁', | ||
], | ||
'砂': [ | ||
'砂', | ||
'沙', | ||
], | ||
'炭': [ | ||
'炭', | ||
'碳', | ||
], | ||
'糸': [ | ||
'糸', | ||
'絲', | ||
'丝', | ||
], | ||
'簷': [ | ||
'簷', | ||
'檐', | ||
], | ||
'涌': [ | ||
'涌', | ||
'湧', | ||
], | ||
'糓': [ | ||
'穀', | ||
'糓', | ||
], | ||
'両': [ | ||
'両', | ||
'两', | ||
'兩', | ||
], | ||
'家': [ | ||
'家', | ||
'傢', | ||
], | ||
'妳': [ | ||
'妳', | ||
'你', | ||
], | ||
'她': [ | ||
'她', | ||
'他', | ||
], | ||
'藤': [ | ||
'藤', | ||
'籐', | ||
'籘', | ||
], | ||
'嬉': [ | ||
'嬉', | ||
'嘻', | ||
], | ||
'亘': [ | ||
'亘', | ||
'亙', | ||
], | ||
'恆': [ | ||
'恆', | ||
'恒', | ||
], | ||
'鶇': [ | ||
'鶇', | ||
'鶫', | ||
'鸫', | ||
], | ||
'姉': [ | ||
'姉', | ||
'姐', | ||
'姊', | ||
], | ||
'剁': [ | ||
'剁', | ||
'刴', | ||
], | ||
'泄': [ | ||
'泄', | ||
'洩', | ||
], | ||
'舖': [ | ||
'舖', | ||
'铺', | ||
'鋪', | ||
'舗', | ||
], | ||
'效': [ | ||
'效', | ||
'効', | ||
], | ||
'喻': [ | ||
'喻', | ||
'喩', | ||
], | ||
'插': [ | ||
'挿', | ||
'插', | ||
'揷', | ||
], | ||
'銳': [ | ||
'銳', | ||
'鋭', | ||
'锐', | ||
], | ||
'權': [ | ||
'權', | ||
'権', | ||
'权', | ||
], | ||
'経': [ | ||
'経', | ||
'經', | ||
'经', | ||
], | ||
'歓': [ | ||
'歓', | ||
'歡', | ||
'欢', | ||
], | ||
'孃': [ | ||
'嬢', | ||
'孃', | ||
], | ||
'済': [ | ||
'済', | ||
'濟', | ||
'济', | ||
], | ||
'收': [ | ||
'収', | ||
'收', | ||
], | ||
'綠': [ | ||
'綠', | ||
'緑', | ||
'绿', | ||
], | ||
'唖': [ | ||
'唖', | ||
'啞', | ||
'哑', | ||
], | ||
'剿': [ | ||
'剿', | ||
'勦', | ||
'𠞰', | ||
], | ||
'禍': [ | ||
'禍', | ||
'禍', | ||
'祸', | ||
], | ||
...jpListLazyAllMap([ | ||
'営', | ||
'産', | ||
'査', | ||
'絵', | ||
'懐', | ||
'釈', | ||
'蔵', | ||
'娯', | ||
'焼', | ||
'拡', | ||
'賎', | ||
'銭', | ||
'雑', | ||
'聴', | ||
'帯', | ||
'閲', | ||
'覧', | ||
'悪', | ||
'亜', | ||
'氷', | ||
]), | ||
'侮': [ | ||
'侮', | ||
'侮', | ||
], | ||
'沉': [ | ||
'沉', | ||
'沈', | ||
], | ||
'嚐': [ | ||
'嚐', | ||
'嘗', | ||
'尝', | ||
], | ||
'搾': [ | ||
'搾', | ||
'榨', | ||
], | ||
'获': [ | ||
'获', | ||
'獲', | ||
'穫', | ||
], | ||
'繮': [ | ||
'繮', | ||
'缰', | ||
'韁', | ||
], | ||
'贋': [ | ||
'贋', | ||
'贗', | ||
'赝', | ||
], | ||
'獃': [ | ||
'呆', | ||
], | ||
'杯': [ | ||
'杯', | ||
'盃', | ||
], | ||
'呪': [ | ||
'呪', | ||
'咒', | ||
'詋', | ||
], | ||
'䇳': [ | ||
'䇳', | ||
'笺', | ||
'箋', | ||
'牋', | ||
], | ||
'竝': [ | ||
'竝', | ||
'𠀤', | ||
], | ||
}; | ||
/** | ||
* 此表內符合以下任意值時會觸發 | ||
*/ | ||
exports.table_plus = _buildTablePlus(table_plus_core); | ||
/** | ||
* 此表內只有符合 KEY 值時才會觸發 | ||
*/ | ||
exports.table_jp = _mergeTable(table_jp_core, exports.table_plus); | ||
_uniqueTable(exports.table_jp); | ||
function _uniqueTable(table_jp) { | ||
Object.keys(table_jp) | ||
.forEach(function (key) { | ||
// @ts-ignore | ||
table_jp[key] = array_hyper_unique_1.array_unique(table_jp[key]); | ||
}); | ||
return table_jp; | ||
} | ||
exports._uniqueTable = _uniqueTable; | ||
function _buildTablePlus(table_plus) { | ||
Object.keys(table_plus) | ||
.forEach(function (key) { | ||
table_plus[key] = array_hyper_unique_1.array_unique(table_plus[key]); | ||
table_plus[key].forEach(function (s) { | ||
table_plus[s] = table_plus[key]; | ||
}); | ||
}); | ||
// @ts-ignore | ||
return table_plus; | ||
} | ||
exports._buildTablePlus = _buildTablePlus; | ||
function _mergeTable(table_jp, table_plus) { | ||
// @ts-ignore | ||
return deepmerge_plus_1.default(table_jp, table_plus); | ||
} | ||
exports._mergeTable = _mergeTable; | ||
exports._table_cn = _update({}, exports._table_tw); | ||
function _update(target, source) { | ||
target = Object.keys(source) | ||
.reduce(function (a, b) { | ||
a[source[b]] = b; | ||
return a; | ||
}, {}); | ||
return target; | ||
} | ||
exports._update = _update; | ||
function _get(arr, value, ...values) { | ||
let ret = [] | ||
.concat(value) | ||
.concat(...values) | ||
.filter(function (v) { | ||
return v; | ||
}); | ||
//ret.length && ret.sort(); | ||
return ret; | ||
} | ||
exports._get = _get; | ||
function jp(char, options = {}) { | ||
let a = []; | ||
a = _get(a, exports.table_jp[char]); | ||
return a; | ||
} | ||
exports.jp = jp; | ||
function tw(char, options = {}) { | ||
let a = []; | ||
a = _get(a, exports._table_tw[char], index_1.cn2tw(char, options)); | ||
//console.log('cn2tw', char, a); | ||
return a; | ||
} | ||
exports.tw = tw; | ||
function cn(char, options = {}) { | ||
let a = []; | ||
a = _get(a, exports._table_cn[char], index_1.tw2cn(char, options)); | ||
//console.log('tw2cn', char, a); | ||
return a; | ||
} | ||
exports.cn = cn; | ||
function jpListLazyAllMap(arr) { | ||
return arr.reduce((a, b) => { | ||
a[b] = jpListLazyAll(b); | ||
return a; | ||
}, {}); | ||
} | ||
function jpListLazyAll(char) { | ||
return list_1.lazyAll(char, { | ||
safe: false, | ||
includeSelf: true, | ||
}); | ||
} | ||
var raw_1 = require("@lazy-cjk/zh-table-alias/lib/table/raw"); | ||
Object.defineProperty(exports, "_table_tw", { enumerable: true, get: function () { return raw_1._table_tw; } }); | ||
__exportStar(require("@lazy-cjk/zh-table-alias"), exports); | ||
__exportStar(require("@lazy-cjk/zh-table-alias/lib/table"), exports); | ||
__exportStar(require("@lazy-cjk/zh-table-alias/lib/util/table"), exports); | ||
__exportStar(require("@lazy-cjk/zh-table-alias/lib/util/unique"), exports); | ||
__exportStar(require("@lazy-cjk/zh-table-alias/lib/util/core"), exports); | ||
__exportStar(require("@lazy-cjk/zh-table-alias/lib/types"), exports); | ||
exports.default = exports; | ||
//# sourceMappingURL=table.js.map |
{ | ||
"name": "cjk-conv", | ||
"version": "1.2.56", | ||
"version": "1.2.57", | ||
"description": "convert chinese, japanese 簡繁日漢字轉換 ( merge/split submodule from node-novel, regexp-cjk, str-util )", | ||
@@ -67,4 +67,4 @@ "keywords": [ | ||
"test": "jest --coverage", | ||
"build-table": "yarn-tool ws run prepublishOnly:lerna && ts-node ./script/build-str-table", | ||
"build-table:commit": "ts-node ./script/publish-after", | ||
"build-table": "yarn workspace @lazy-cjk/static-build-zh-convert run build", | ||
"build-table:commit": "yarn workspace @lazy-cjk/static-build-zh-convert run build:commit", | ||
"npm:publish": "npm publish", | ||
@@ -86,7 +86,12 @@ "npm:publish:lerna": "npx lerna publish --yes --cd-version patch", | ||
"dependencies": { | ||
"@lazy-cjk/jp-table-alias": "^1.0.1", | ||
"@lazy-cjk/jp-table-comparison": "^1.0.2", | ||
"@lazy-cjk/jp-table-convert": "^1.0.2", | ||
"@lazy-cjk/jp-table-voice": "^1.0.3", | ||
"@lazy-cjk/jp-table-convert": "^1.0.3", | ||
"@lazy-cjk/jp-table-voice": "^1.0.4", | ||
"@lazy-cjk/novel-filename": "^1.0.1", | ||
"@lazy-cjk/util": "^1.0.1", | ||
"@lazy-cjk/zh-convert-table": "^1.0.3", | ||
"@lazy-cjk/zh-table-greedy": "^1.0.10", | ||
"@lazy-cjk/zh-table-alias": "^1.0.1", | ||
"@lazy-cjk/zh-table-greedy": "^1.0.11", | ||
"@lazy-cjk/zh-table-list": "^1.0.1", | ||
"array-hyper-unique": "^1.1.0", | ||
@@ -108,3 +113,3 @@ "chinese_convert": "1.0.8", | ||
}, | ||
"gitHead": "6706b6befff4c85bf410ebf7e003b1bbb121501e" | ||
"gitHead": "3c7ff7966b97974b7ed9303c6e0a746e8b5fc161" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
403243
17
73
36423
+ Added@lazy-cjk/util@^1.0.1
+ Added@lazy-cjk/jp-table-alias@1.0.46(transitive)
+ Added@lazy-cjk/novel-filename@1.0.56(transitive)
+ Added@lazy-cjk/static-build-zh-convert@1.0.57(transitive)
+ Added@lazy-cjk/util@1.0.20(transitive)
+ Added@lazy-cjk/zh-convert@1.0.54(transitive)
+ Added@lazy-cjk/zh-table-alias@1.0.68(transitive)
+ Added@lazy-cjk/zh-table-list@1.0.90(transitive)
+ Addeddeepmerge-plus@3.0.2(transitive)
+ Addedis-mergeable-object@1.1.1(transitive)