Watch 1 Star 0

码云极速下载 / chinese_pinyinMIT

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/zhangsoledad/alchemic_pinyin
Nothing here. spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

alchemic_pinyin

Build Status Inline docs

中文汉字转拼音

Inspired by chinese_pinyin.

Installation

  1. Add pinyin to your list of dependencies in mix.exs:
def deps do
  [{:alchemic_pinyin, "~> 0.1.0"}]
end
  1. Ensure pinyin is started before your application:
def application do
  [applications: [:alchemic_pinyin]]
end

Usage

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"

benchmark

mix bench

OS X

2.7 GHz Intel Core i5 8 GB 1867 MHz DDR3

Settings:
  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

Comments ( 0 )

You need to Sign in for post a comment

Help Search