Comparing version 1.0.15 to 1.0.17
export declare let TABLE: string[][]; | ||
export declare let TABLE_SAFE: string[][]; | ||
export declare function addNew(table: string[][], jp: any, zht: any, zhs: any): string[][]; | ||
export declare let TABLE_SAFE: string[][]; | ||
export default TABLE; |
@@ -17,16 +17,3 @@ "use strict"; | ||
const teachKanjiComparison = require('./teachKanjiComparison.json'); | ||
exports.TABLE = []; | ||
function addNew(table, jp, zht, zhs) { | ||
jp = Array.isArray(jp) ? jp : [jp]; | ||
zht = Array.isArray(zht) ? zht : [zht]; | ||
zhs = Array.isArray(zhs) ? zhs : [zhs]; | ||
table.push([ | ||
jp, | ||
zht, | ||
zhs, | ||
]); | ||
return table; | ||
} | ||
exports.addNew = addNew; | ||
[ | ||
const PLUS_TABLE = [ | ||
['蝕', '蝕', '蚀'], | ||
@@ -49,3 +36,9 @@ ["絲", "絲", "丝"], | ||
["館", "館", "馆"], | ||
].forEach(function ([jp, zht, zhs]) { | ||
["槍", "槍", "枪"], | ||
]; | ||
const PLUS_TABLE_SAFE = [ | ||
["歴", "歷", "历"], | ||
]; | ||
exports.TABLE = []; | ||
PLUS_TABLE.forEach(function ([jp, zht, zhs]) { | ||
addNew(exports.TABLE, jp, zht, zhs); | ||
@@ -74,2 +67,6 @@ }); | ||
exports.TABLE_SAFE = []; | ||
PLUS_TABLE_SAFE.forEach(function ([jp, zht, zhs]) { | ||
addNew(exports.TABLE, jp, zht, zhs); | ||
addNew(exports.TABLE_SAFE, jp, zht, zhs); | ||
}); | ||
let cache = []; | ||
@@ -107,3 +104,19 @@ for (let i in exports.TABLE) { | ||
} | ||
function addNew(table, jp, zht, zhs) { | ||
jp = Array.isArray(jp) ? jp : [jp]; | ||
zht = Array.isArray(zht) ? zht : [zht]; | ||
zhs = Array.isArray(zhs) ? zhs : [zhs]; | ||
table.push([ | ||
jp, | ||
zht, | ||
zhs, | ||
]); | ||
return table; | ||
} | ||
exports.addNew = addNew; | ||
exports.default = exports.TABLE; | ||
//export default exports; | ||
if (0) { | ||
console.log(exports.TABLE_SAFE); | ||
//fs.writeFileSync('./temp.json', JSON.stringify(TABLE_SAFE, null, "\t")); | ||
} |
@@ -11,2 +11,4 @@ /** | ||
import * as fs from 'fs'; | ||
/** | ||
@@ -18,20 +20,5 @@ * 資料來源 https://www.jpmarumaru.com/tw/teachKanjiComparison.asp | ||
export let TABLE = [] as string[][]; | ||
type IPLUS_TABLE = [string, string, string][]; | ||
export function addNew(table: string[][], jp, zht, zhs): string[][] | ||
{ | ||
jp = Array.isArray(jp) ? jp : [jp]; | ||
zht = Array.isArray(zht) ? zht : [zht]; | ||
zhs = Array.isArray(zhs) ? zhs : [zhs]; | ||
table.push([ | ||
jp, | ||
zht, | ||
zhs, | ||
]); | ||
return table; | ||
} | ||
[ | ||
const PLUS_TABLE: IPLUS_TABLE = [ | ||
['蝕', '蝕', '蚀'], | ||
@@ -64,6 +51,18 @@ ["絲", "絲", "丝"], | ||
["槍", "槍", "枪"], | ||
//["兎", "兔", "兔"], | ||
//["兔", "兔", "兔"], | ||
].forEach(function ([jp, zht, zhs]) | ||
]; | ||
const PLUS_TABLE_SAFE: IPLUS_TABLE = [ | ||
["歴", "歷", "历"], | ||
]; | ||
export let TABLE = [] as string[][]; | ||
PLUS_TABLE.forEach(function ([jp, zht, zhs]) | ||
{ | ||
@@ -102,2 +101,9 @@ addNew(TABLE, jp, zht, zhs); | ||
TABLE_SAFE = []; | ||
PLUS_TABLE_SAFE.forEach(function ([jp, zht, zhs]) | ||
{ | ||
addNew(TABLE, jp, zht, zhs); | ||
addNew(TABLE_SAFE, jp, zht, zhs); | ||
}); | ||
let cache = []; | ||
@@ -153,3 +159,24 @@ | ||
export function addNew(table: string[][], jp, zht, zhs): string[][] | ||
{ | ||
jp = Array.isArray(jp) ? jp : [jp]; | ||
zht = Array.isArray(zht) ? zht : [zht]; | ||
zhs = Array.isArray(zhs) ? zhs : [zhs]; | ||
table.push([ | ||
jp, | ||
zht, | ||
zhs, | ||
]); | ||
return table; | ||
} | ||
export default TABLE; | ||
//export default exports; | ||
if (0) | ||
{ | ||
console.log(TABLE_SAFE); | ||
//fs.writeFileSync('./temp.json', JSON.stringify(TABLE_SAFE, null, "\t")); | ||
} |
export interface IOptions { | ||
skip?: string; | ||
safe?: boolean; | ||
} | ||
@@ -4,0 +5,0 @@ export declare function filename(name: string, options?: IOptions): string; |
@@ -7,2 +7,3 @@ "use strict"; | ||
const jp_1 = require("../jp"); | ||
const convert_1 = require("../zh/convert"); | ||
function filename(name, options = {}) { | ||
@@ -20,3 +21,4 @@ return jp(name, options) | ||
// @ts-ignore | ||
skip: '龙竜龍制征里像拜冰澤涉丑兒娘志' + (options.skip || ''), | ||
skip: '龙竜龍制征里像拜冰澤涉丑兒娘姐姉志儿' + (options.skip || ''), | ||
safe: typeof options.safe == 'boolean' ? options.safe : true, | ||
})) | ||
@@ -44,3 +46,6 @@ .replace(/诅/g, '詛') | ||
.replace(/回复/g, '回復') | ||
.replace(/复(仇|讐)/g, '復$1'); | ||
.replace(/复(仇|讐)/g, '復$1') | ||
.replace(/[么预枪丛迈这个尔儿]+/g, function (s) { | ||
return convert_1.cn2tw(s); | ||
}); | ||
} | ||
@@ -47,0 +52,0 @@ exports.zh = zh; |
@@ -6,2 +6,3 @@ /** | ||
import { zh2jp } from '../jp'; | ||
import { cn2tw } from '../zh/convert'; | ||
@@ -11,2 +12,3 @@ export interface IOptions | ||
skip?: string, | ||
safe?: boolean, | ||
} | ||
@@ -30,3 +32,4 @@ | ||
// @ts-ignore | ||
skip: '龙竜龍制征里像拜冰澤涉丑兒娘志' + (options.skip || ''), | ||
skip: '龙竜龍制征里像拜冰澤涉丑兒娘姐姉志儿' + (options.skip || ''), | ||
safe: typeof options.safe == 'boolean' ? options.safe : true, | ||
})) | ||
@@ -61,2 +64,8 @@ .replace(/诅/g, '詛') | ||
.replace(/复(仇|讐)/g, '復$1') | ||
.replace(/[么预枪丛迈这个尔儿]+/g, function (s) | ||
{ | ||
return cn2tw(s) | ||
}) | ||
//.replace(/死后/g, '死後') | ||
@@ -63,0 +72,0 @@ //.replace(/当/g, '當') |
@@ -30,2 +30,4 @@ export declare let _table_tw: { | ||
'鳥': string[]; | ||
'視': string[]; | ||
'険': string[]; | ||
}; | ||
@@ -32,0 +34,0 @@ export interface ISimpleTable { |
@@ -112,2 +112,15 @@ "use strict"; | ||
], | ||
'視': [ | ||
'視', | ||
'視', | ||
'视', | ||
'眎', | ||
], | ||
'険': [ | ||
'険', | ||
'險', | ||
'险', | ||
'嶮', | ||
'崄', | ||
], | ||
}; | ||
@@ -114,0 +127,0 @@ Object.keys(exports.table_plus) |
@@ -115,2 +115,15 @@ /** | ||
], | ||
'視': [ | ||
'視', | ||
'視', | ||
'视', | ||
'眎', | ||
], | ||
'険': [ | ||
'険', | ||
'險', | ||
'险', | ||
'嶮', | ||
'崄', | ||
], | ||
}; | ||
@@ -117,0 +130,0 @@ |
{ | ||
"name": "cjk-conv", | ||
"version": "1.0.15", | ||
"version": "1.0.17", | ||
"description": "convert chinese, japanese 簡繁日漢字轉換 ( merge/split submodule from node-novel, regexp-cjk, str-util )", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
433505
37873