Han v0.3.3 Han View Source
Utils for processing chinese.
Link to this section Summary
Functions
Public function to convert chinese words to pinyin.
Public function to slugify chinese words.
Public function to translate chinese.
Link to this section Functions
Link to this function
pinyin(content) View Source
Public function to convert chinese words to pinyin.
Examples
iex> Han.pinyin("中国")
"zhōng guó"
iex> Han.pinyin("中国", :simplified)
"zhōng guó"
iex> Han.pinyin("中國", :traditional)
"zhōng guó"
Link to this function
pinyin(content, atom) View Source
Link to this function
slugify(content) View Source
Public function to slugify chinese words.
Examples
iex> Han.slugify("中国")
"zhong-guo"
iex> Han.slugify("中國", :traditional)
"zhong-guo"
iex> Han.slugify(" *& 46 848 中 ----- 国")
"46-848-zhong-guo"
iex> Han.slugify("关于 Elixir 的 HTML5 页面")
"guan-yu-elixir-de-html5-ye-mian"
Link to this function
slugify(content, atom) View Source
Link to this function
translate(content) View Source
Public function to translate chinese.
Examples
iex> Han.translate("中国")
"中國"
iex> Han.translate("中国", :simplified)
"中國"
iex> Han.translate("中國", :traditional)
"中国"
Link to this function