Converts Japanese kanji numerals into full-width numerals and arabic numbers.
Based on kitagawa-hr/japanese-number-converter which is based on twada/japanese-numerals-to-number.
import jnc
assert jnc.ja_to_arabic("九千七兆千九百九十二億五千四百七十四万九百九十一") == 9007199254740991
For detail, see test cases.
assert jnc.ja_to_arabic("亜県水戸郡余市東町十二線四号", ignore_non_numerals=True) == "亜県水戸郡余市東町12線4号"
assert jnc.ja_to_arabic("亜県水戸郡余市東町十二線四号", ignore_non_numerals=True, full_width_output=True) == "亜県水戸郡余市東町12線4号"
Output in the original usage is of type int
, but with my modifications, it's str
.
pip install "git+https://github.com/Flurrywinde/japanese-numbers-converter.git"
〇
,一
,二
,三
,四
,五
,六
,七
,八
,九
十
,百
,千
,万
,億
,兆
壱
,弐
,参
,拾