Try to translate Kanji to Romaji.
Project description
Formerly kana_to_romaji
Tries to translate Kanji to Romaji with the help of JMdict
Some typograhic characters are also translated since one of the
original goals was to make the string printable in ascii
Installation
pip install kanji_to_romaji
or if pip is not available:
git clone https://github.com/rcamba/kanji_to_romaji
install.bat
Usage
ktr.py is a script included to be used in the command line provided you have your python’s script folder in your environment variables
> ktr.py 友達に会いました
tomodachi ni aimashita
Although Windows cmd doesn’t seem to natively support unicode
characters so you can use unicode escaped strings if you’d like…
> ktr.py \u53cb\u9054\u306b\u4f1a\u3044\u307e\u3057\u305f
tomodachi ni aimashita
The more common usage will probably to be used in another program:
from kanji_to_romaji import kanji_to_romaji print kanji_to_romaji(u"友達に会いました")
Argument must be in unicode
More examples
私は嬉: watashi wa ureshii
更に向こうへ: sarani mukou e
友達に会いました: tomodachi ni aimashita
車には一人分の空きがあった: kuruma ni wa hitoribun no aki ga atta
bl∞dy☆: bl dy
乷: \u4e77 (not in Kanji unicode range)
See tests\test_kanji.py for more examples
Note: The particles は (ha/wa) or へ (he/e) won’t always be
translated properly. Same goes for some of the Kanji translations
since there are multiple possible readings for some of them depending
on the context.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Kanji_to_Romaji-1.0.0.zip
(2.5 MB
view details)
File details
Details for the file Kanji_to_Romaji-1.0.0.zip
.
File metadata
- Download URL: Kanji_to_Romaji-1.0.0.zip
- Upload date:
- Size: 2.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d347244daf9eb233d8add3ff112edab508ebc56dacd9fb1490ca8da868f5a52 |
|
MD5 | 05b2e5e90381a463fbfb739a91b9ddd4 |
|
BLAKE2b-256 | 07f56b0fc8db2dc66b9a442aa5f20be170a443a720543531ad643e1b973fc395 |