- Notifications
You must be signed in to change notification settings - Fork20
A fast converter between Japanese hankaku and zenkaku characters
License
NotificationsYou must be signed in to change notification settings
studio-ousia/mojimoji
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A Cython-based fast converter between Japanese hankaku and zenkaku characters.
$ pip install mojimoji
>>>importmojimoji>>>print(mojimoji.zen_to_han('アイウabc012'))アイウabc012>>>print(mojimoji.zen_to_han('アイウabc012',kana=False))アイウabc012>>>print(mojimoji.zen_to_han('アイウabc012',digit=False))アイウabc012>>>print(mojimoji.zen_to_han('アイウabc012',ascii=False))アイウabc012
>>>importmojimoji>>>print(mojimoji.han_to_zen('アイウabc012'))アイウabc012>>>print(mojimoji.han_to_zen('アイウabc012',kana=False))アイウabc012>>>print(mojimoji.han_to_zen('アイウabc012',digit=False))アイウabc012>>>print(mojimoji.han_to_zen('アイウabc012',ascii=False))アイウabc012
- mojimoji: 0.0.1
- zenhan: 0.4
- unicodedata: Bundled with Python 2.7.3
In [19]:s='ABCDEFG012345'*10In [20]:%timeforninrange(1000000):mojimoji.zen_to_han(s)CPUtimes:user2.86s,sys:0.10s,total:2.97sWalltime:2.88sIn [21]:%timeforninrange(1000000):unicodedata.normalize('NFKC',s)CPUtimes:user5.43s,sys:0.12s,total:5.55sWalltime:5.44sIn [22]:%timeforninrange(1000000):zenhan.z2h(s)CPUtimes:user69.18s,sys:0.11s,total:69.29sWalltime:69.48s
- mojimoji-rs: The Rust implementation of mojimoji
- gomojimoji: The Go implementation of mojimoji
About
A fast converter between Japanese hankaku and zenkaku characters
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.