Skip to main content

Python implementation of kakasi - kana kanji simple inversion library

Project description

Overview

Documentation Status PyPI version Travis-CI Azure-Pipelines Coverage status

pykakasi is Natural Language Proseccing(NLP) library to convert Kana-Kanji Japanese clauses into Roman-Kana with separator in python. This is improved kakasi library (original is written in C) in Python.

pykakasi at glance

Install:

pip install pykakasi

Sample source code:

$ python
>>> import pykakasi
>>>
>>> text = u"かな漢字交じり文"
>>> kakasi = pykakasi.kakasi()
>>> kakasi.setMode("H","a") # Hiragana to ascii, default: no conversion
>>> kakasi.setMode("K","a") # Katakana to ascii, default: no conversion
>>> kakasi.setMode("J","a") # Japanese to ascii, default: no conversion
>>> kakasi.setMode("r","Hepburn") # default: use Hepburn Roman table
>>> kakasi.setMode("s", True) # add space, default: no separator
>>> kakasi.setMode("C", True) # capitalize, default: no capitalize
>>> conv = kakasi.getConverter()
>>> result = conv.do(text)
>>> print(result)
kana Kanji Majiri Bun
>>>
>>>
>>> wakati = pykakasi.wakati()
>>> conv = wakati.getConverter()
>>> result = conv.do(text)
>>> print(result)
かな 漢字 交じり 文
>>>
>>> kakasi = pykakasi.kakasi()
>>> kakasi.setMode("J","aF") # Japanese to furigana
>>> kakasi.setMode("H","aF") # Japanese to furigana
>>> conv = kakasi.getConverter()
>>> result = conv.do(text)
>>> print(result)
かな[kana] 漢字[Kanji] 交じり[Majiri] 文[Bun]
>>>

You can use output Mode values from “H”, “K”, “a” which is each means “Hiragana”, “Katakana” and “Alphabet”. For input, you can use “J” that means “Japanese” that is mixture of Kanji, Katakana and Hiragana. Also there is values of “H”, “K” that means “Hiragana”, and “Katakana”. You can use “Hepburn” , “Kunrei” or “Passport” as mode “r”, Roman table switch. Also “s” used for separator switch, “C” for capitalize switch. “S” for separator storing option.

wakati is an implementation of kakasi’s wakati gaki option.

Documentation

Manual is placed on readthedocs.

Project details


Download files

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

Source Distribution

pykakasi-1.0rc2.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pykakasi-1.0rc2-pypy-none-any.whl (2.6 MB view details)

Uploaded Python p.y

pykakasi-1.0rc2-py35-none-any.whl (2.7 MB view details)

Uploaded Python 3.5

pykakasi-1.0rc2-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

pykakasi-1.0rc2-py2-none-any.whl (2.7 MB view details)

Uploaded Python 2

File details

Details for the file pykakasi-1.0rc2.tar.gz.

File metadata

  • Download URL: pykakasi-1.0rc2.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

File hashes

Hashes for pykakasi-1.0rc2.tar.gz
Algorithm Hash digest
SHA256 2e6b0745c9427bc2ec07fe729c4c57685a0256472713ffcf7e090d43d85d3ce8
MD5 251e28ec3ab31e6e8ffba259005d38e9
BLAKE2b-256 13fcced957d087ca29b1b1815699c454977fa139e669da0c26078edc06fe86d6

See more details on using hashes here.

File details

Details for the file pykakasi-1.0rc2-pypy-none-any.whl.

File metadata

  • Download URL: pykakasi-1.0rc2-pypy-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python p.y
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 PyPy/7.1.1

File hashes

Hashes for pykakasi-1.0rc2-pypy-none-any.whl
Algorithm Hash digest
SHA256 7b68c82bd57d865f5ab3c71bbe14e35f3619f868a22aa5f482de502579f6b1ad
MD5 7cc90a01fffd6d3f6b334c1319c45f45
BLAKE2b-256 82b8083840cce8e736f4a918f28dc59c39dc01db17e62ec15e0e0a52fc01ff72

See more details on using hashes here.

File details

Details for the file pykakasi-1.0rc2-py35-none-any.whl.

File metadata

  • Download URL: pykakasi-1.0rc2-py35-none-any.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: Python 3.5
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.6

File hashes

Hashes for pykakasi-1.0rc2-py35-none-any.whl
Algorithm Hash digest
SHA256 d0854c4b608b3d7788bf5cde81c5bf4d4b960f8d273dc1ef56c7d5fb0193db9e
MD5 c531ad2b810ff2094078d18a0a711f48
BLAKE2b-256 597ede24fa63faa6bd052268b33b8b307d18dbf0236465d9bc02470f51674726

See more details on using hashes here.

File details

Details for the file pykakasi-1.0rc2-py3-none-any.whl.

File metadata

  • Download URL: pykakasi-1.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7

File hashes

Hashes for pykakasi-1.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 3cdca059058ea80711c04d41e9004c814089d2fbd7b1d642c5e4c59c1b1c58c4
MD5 47bda471969b180f452238a9837ca1aa
BLAKE2b-256 422b8f215ad04420d7b6a3eea4009487b4a68678406cf4cd30e8b0c00b2a6ad7

See more details on using hashes here.

File details

Details for the file pykakasi-1.0rc2-py2-none-any.whl.

File metadata

  • Download URL: pykakasi-1.0rc2-py2-none-any.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

File hashes

Hashes for pykakasi-1.0rc2-py2-none-any.whl
Algorithm Hash digest
SHA256 37e942733bbeba2f1f323024ca6efe4a620f6420acf9a5fb2d10234d79eebe48
MD5 879addd00b9767033cb5c5a76719092c
BLAKE2b-256 b9e644a83f51c24f4f3d02c424aeebf2ae91db7c99bca52ca95240a3aec406aa

See more details on using hashes here.

Supported by

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