Skip to main content

A converter to romanize Japanese hiragana/katakana string

Project description

romaji

romaji is a converter library to romanize Japanese hiragana/katakana string by standard and IME typing style. Even though pykakasi already has provided the same functions, and returns only one romanized string. However, there exists several different romanization systems, so one hiragana/katakana string has so many romanize string. For example, “ちゃ” can be romanized as “cha”, “tya”, “chixya”, “tixya”, “chilya”, or “tilya”. romaji provides romanized strings as many as possible.

If an input string contained non hiragana/katakana characters (includes kanji), romaji return the characters as same as the input. For example, romaji converts the input “お茶の水” to “o茶no水”. If there is a need to romanize the whole string which includes kanji, romaji can romaize the readings in the tokens which Janome tokenizer provides. romaji strongly recommends to use with Janome.

The mapping from hiragana/katakana to romaji is based on common IME’s system to input Japanese. Therefor, romaji does not directly implement the standard system like Hepburn, Nihon-shiki or Kunrei-shiki, but includes them.

Installation

$ pip install romaji

Usage

>>> import romaji
>>> romaji.transliterate('僕ドラえもん')
['僕doraemon', '僕doraemon\'', '僕doraemonn']
>>> romaji.transliterate('諸行無常')
[]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

romaji-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file romaji-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: romaji-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/2.7.17

File hashes

Hashes for romaji-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57bfd61c6d0c7ed547b918bb4852ebd7409b257661da8a40d1065e5853efcc97
MD5 e28cdba3b3d2b8e8090ec33e44a16c04
BLAKE2b-256 7ce1af955f28f6a266ea8848472287946ede7ba4762a224410f1ac6bf676664b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page