Cn2An.jl

CompatHelperMIT Licensestars

Convert Chinese Numerals To Arabic Numerals With Julia Language.

You can learn by referring to the functions of this libray: cn2an.

Install

## In Julia REPL
julia> ]
pkg> add Cn2An
# or
pkg> add https://github.com/Ailln/Cn2An.jl

## In Julia file and REPL
using Pkg
Pkg.add("Cn2An")
# or
Pkg.add(PackageSpec(url="https://github.com/Ailln/Cn2An.jl"))

Usage

import Cn2An:cn2an
import Cn2An:an2cn

println(cn2an("一百二十三"))
# 123
println(an2cn(123))
# 一百二十三

Performance

Compare the performance of cn2an function running one million times on Python and Julia respectively.

NO.languagefunctiontimescost(s)code
1Pythonan2cn core10000007.379an2cn
2Juliaan2cn core10000002.822an2cn

From the results, we can see that Julia is almost three times faster!

License

Reference