ChineseTranslation v0.2.0 ChineseTranslation View Source
this module only utilize zh2Hant to do translation from simplified chinese to traditional chinese, and vise versa.
Link to this section Summary
Functions
Public function to convert Chinese words to pinyin. Example
Public function to slugify Chinese words. Example
Public function to do Chinese translation. Example
Link to this section Functions
Public function to convert Chinese words to pinyin. Example:
iex> ChineseTranslation.pinyin("我是中国人")
"wǒ shì zhōng guó rén"
iex> ChineseTranslation.pinyin("我是中國人", :trad)
"wǒ shì zhōng guó rén"
Public function to slugify Chinese words. Example:
iex> ChineseTranslation.slugify("我是中国人")
"wo-shi-zhong-guo-ren"
iex> ChineseTranslation.slugify("我是中國人", [:trad, :tone])
"wo3-shi4-zhong1-guo2-ren2"
iex> ChineseTranslation.slugify(" *& 我是46 848 中 ----- 国人")
"wo-shi-zhong-guo-ren"
Public function to do Chinese translation. Example:
iex> ChineseTranslation.translate("我是中国人", :s2t)
"我是中國人"
iex> ChineseTranslation.translate("我是中國人")
"我是中国人"