Skip to main content
Deno 2 is finally here 🎉️
Learn more

ts_cn_and_tw

javascript: https://github.com/anqisoft/js_cn_and_tw
npmjs: https://www.npmjs.com/package/@dishanqian/cn_and_tw

import

import { cn2tw, tw2cn } from 'https://deno.land/x/cn_and_tw@v0.0.2/index.ts';

test

['个', '计算机', '天干'].forEach(from => console.log(from, cn2tw(from))));
['個', '計算機', '天干'].forEach(from => console.log(from, tw2cn(from))));

Provides basic functions for bidirectional conversion between Simplified and Traditional Chinese.
Created on Wed Jan 10 2024 07:02:57
Feature: Provide the following content,

  • string array, simplified character list SIMPLIFIED_CHINESE_CHARS
  • string array, traditional Chinese character list TRADITIONAL_CHINESE_CHARS
  • string array, simplified to traditional phrase correspondence table CHINESE_PHRASES_FROM_SIMPLIFIED_TO_TRADITIONAL
  • string array, Traditional to Simplified phrase correspondence table CHINESE_PHRASES_FROM_TRADITIONAL_TO_SIMPLIFIED
  • Method, simple to traditional cn2tw(original: string): string
  • Method, convert traditional to simplified tw2cn(original: string): string

提供简体与繁体双向转换基础函数。
创建:2024年1月10日 07:02:57
功能:提供以下内容,

  • 字符串数组,简体单字清单 SIMPLIFIED_CHINESE_CHARS
  • 字符串数组,繁体单字清单 TRADITIONAL_CHINESE_CHARS
  • 字符串数组,简转繁词组对应表 CHINESE_PHRASES_FROM_SIMPLIFIED_TO_TRADITIONAL
  • 字符串数组,繁转简词组对应表 CHINESE_PHRASES_FROM_TRADITIONAL_TO_SIMPLIFIED
  • 方法,简转繁 cn2tw(original: string): string
  • 方法,繁转简 tw2cn(original: string): string

提供簡體與繁體雙向轉換基礎函數。
創建:2024年1月10日 07:02:57
功能:提供以下內容,

  • 字元串數組,簡體單字清單 SIMPLIFIED_CHINESE_CHARS
  • 字元串數組,繁體單字清單 TRADITIONAL_CHINESE_CHARS
  • 字元串數組,簡轉繁片語對應錶 CHINESE_PHRASES_FROM_SIMPLIFIED_TO_TRADITIONAL
  • 字元串數組,繁轉簡片語對應錶 CHINESE_PHRASES_FROM_TRADITIONAL_TO_SIMPLIFIED
  • 方法,簡轉繁 cn2tw(original: string): string
  • 方法,繁轉簡 tw2cn(original: string): string