alchemic_pinyin 汉字转拼音应用 项目简介
alchemic_pinyin是一个中文汉字转拼音应用。安装添加“pinyin”到您 mix.exs 中的依赖列表 def deps do
[{:alchemic_pinyin, "~> 0.1.0"}]
end确保“pinyin”已经启动def application do
[applications: [:alchemic_pinyin]]
end用法iex> Pinyin.from_string("龡龢龣龤龥癩")
"chui he jue xie yu la"
iex> Pinyin.from_string("龡龢龣龤龥癩", tone: true)
"chùi hé júe xíe yù là"
iex> Pinyin.from_string("龡龢龣龤龥癩", splitter: "-")
"chui-he-jue-xie-yu-la"
iex> Pinyin.from_string("龡龢龣龤龥癩", [], &String.first/1)
"c"基准测试mix benchOS X2.7 GHz Intel Core i5 8 GB 1867 MHz DDR3Settings:
duration: 1.0 s
BasicBench
[14:01:23] 1/1: hello pinyin
Finished in 4.11 seconds
BasicBench
hello pinyin 500000 6.73 µs/op
[{:alchemic_pinyin, "~> 0.1.0"}]
end确保“pinyin”已经启动def application do
[applications: [:alchemic_pinyin]]
end用法iex> Pinyin.from_string("龡龢龣龤龥癩")
"chui he jue xie yu la"
iex> Pinyin.from_string("龡龢龣龤龥癩", tone: true)
"chùi hé júe xíe yù là"
iex> Pinyin.from_string("龡龢龣龤龥癩", splitter: "-")
"chui-he-jue-xie-yu-la"
iex> Pinyin.from_string("龡龢龣龤龥癩", [], &String.first/1)
"c"基准测试mix benchOS X2.7 GHz Intel Core i5 8 GB 1867 MHz DDR3Settings:
duration: 1.0 s
BasicBench
[14:01:23] 1/1: hello pinyin
Finished in 4.11 seconds
BasicBench
hello pinyin 500000 6.73 µs/op