simplify-traditional
Version:
Convert between Chinese Simplify and Hongkong or Taiwan Traditional chars 中文简体 和 台湾,香港繁体转换
48 lines (45 loc) • 1.6 kB
JavaScript
(function (factory) {
typeof define === 'function' && define.amd ? define(factory) :
factory();
})((function () { 'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.tradi_to_simp_tw = exports.tradi_to_simp_hk = exports.simp_to_tradi_tw = exports.simp_to_tradi_hk = void 0;
const ToolGood_Words_Translate_1 = require("./ToolGood.Words.Translate");
const translator = new ToolGood_Words_Translate_1.Translate();
/**
* 简体 -> 台湾繁体
* @param {string} text 原文本
* @return {string} 转换结果
*/
function simp_to_tradi_hk(text) {
return translator.ToTraditionalChinese(text, 2);
}
exports.simp_to_tradi_hk = simp_to_tradi_hk;
/**
* 简体 -> 香港繁体
* @param {string} text 原文本
* @return {string} 转换结果
*/
function simp_to_tradi_tw(text) {
return translator.ToTraditionalChinese(text, 1);
}
exports.simp_to_tradi_tw = simp_to_tradi_tw;
/**
* 香港繁体 -> 简体
* @param {string} text 原文本
* @return {string} 转换结果
*/
function tradi_to_simp_hk(text) {
return translator.ToSimplifiedChinese(text, 1);
}
exports.tradi_to_simp_hk = tradi_to_simp_hk;
/**
* 台湾繁体 -> 简体
* @param {string} text 原文本
* @return {string} 转换结果
*/
function tradi_to_simp_tw(text) {
return translator.ToSimplifiedChinese(text, 2);
}
exports.tradi_to_simp_tw = tradi_to_simp_tw;
}));