#localization #cli #chinese #mediawiki #opencc #chinese-translation #wikipedia #traditional-chinese #text #simplified-chinese

app zhconv-cli

Convert Traditional/Simplified Chinese and regional words of Taiwan/Hong Kong/mainland China/Singapore based on Wikipedia conversion tables 轉換中文簡體、繁體及兩岸、新馬地區詞,基於中文維基轉換表

4 releases

0.1.0 Sep 8, 2022
0.1.0-rc Aug 12, 2022
0.1.0-beta Dec 27, 2021

#683 in Text processing


24K SLoC

PHP 21K SLoC // 0.0% comments Rust 1K SLoC // 0.1% comments TSX 1K SLoC // 0.1% comments Python 256 SLoC // 0.3% comments JavaScript 26 SLoC // 0.3% comments TypeScript 22 SLoC // 0.2% comments

zhconv-cli 中文简繁及地區詞轉換

zhconv-cli converts Chinese text among several scripts or regional variants (e.g. zh-TW <-> zh-CN <-> zh-HK <-> zh-Hans <-> zh-Hant), built on the top of zhConversion.php conversion tables from Mediawiki, which is the one also used on Chinese Wikipedia.

For more information, check zhconv-rs.

    zhconv [FLAGS] [OPTIONS] <VARIANT> [--] [FILE]...

        --mediawiki    Processes inline MediaWiki conversion rules in the input
    -h, --help         Prints help information
    -V, --version      Prints version information

        --rule <rules>...               Additional conversion rules
        --rules_file <rule-files>...    File(s) consisting of additional conversion rules seperated by LF
        --dfa <dfa>                     Whether to build DFA for AC automaton
                                         With DFA enabled by default, it is slower to warm up while faster to convert.
                                         Omit to let the program to determine by input size

    <VARIANT>    Target variant to convert to (zh, zh-Hant, zh-Hans, zh-TW, zh-HK, zh-MO, zh-CN, zh-SG, zh-MY)
    <FILE>...    File(s) to convert in-place (omit for stdin/out)


~217K SLoC