Skip to main content

Python implementation of kakasi - kana kanji simple inversion library

Project description

=======
Pykakasi
=======


Overview
========

.. image:: https://travis-ci.org/miurahr/pykakasi.svg?branch=master
:target: https://travis-ci.org/miurahr/pykakasi
:alt: Travis-CI

.. image:: https://badge.fury.io/py/pykakasi.png
:target: http://badge.fury.io/py/Pykakasi
:alt: PyPI version

.. image:: https://coveralls.io/repos/miurahr/pykakasi/badge.svg?branch=master
:target: https://coveralls.io/r/miurahr/pykakasi?branch=master
:alt: Coverage status

pykakasi is re-implementation of kakasi library by Python.

How To Use pykakasi
==================

Install with pip::

pip install pykakasi

Version: 0.23 released in 2014

Status: Alpha development status

Build and install from source(recommend)::

git clone https://github.com/miurahr/pykakasi.git
cd pykakasi
python setup.py build
python setup.py install
python setup.py clean

Run test using pyenv/tox::

pyenv install 2.7.13
pyenv install 3.3.7
pyenv install 3.4.8
pyenv install 3.5.5
pyenv install 3.6.4
pyenv local 2.7.13, 3.3.7, 3.4.6, 3.5.5, 3.6.4
tox

Building library, setup script build dictionary db file and generate pickled db files.
Without dictionary files, a library fails to run.

Sample source code::

from pykakasi import kakasi,wakati

kakasi = kakasi()
kakasi.setMode("H","a") # default: Hiragana no conversion
kakasi.setMode("K","a") # default: Katakana no conversion
kakasi.setMode("J","a") # default: Japanese 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)

wakati = wakati()
conv = kawati.getConverter()
result = conv.do(text)

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.

Options
=======

These switch alphabets are derived from original Kakasi.
Now it support following options:

+--------+---------------------+------------+-----------------------------+
| Option | Description | Values | Note |
+========+=====================+============+=============================+
| K | Katakana convertion | a,H,None | roman or noconversion |
+--------+---------------------+------------+-----------------------------+
| H | Hiragana convertion | a,K,None | roman or noconversion |
+--------+---------------------+------------+-----------------------------+
| J | Kanji conversion | a,H,K,None | roman or Hiragana, Katakana |
+--------+---------------------+------------+-----------------------------+
| E | Eigou convesion | a,None | roman or noconversion |
+--------+---------------------+------------+-----------------------------+

Each character means character sets as follows:

::
Character Sets
a: ascii j: jisroman g: graphic k: kana
(j,k defined in jisx0201)
E: kigou K: katakana H: hiragana J: kanji
(E,K,H,J defined in jisx0208)




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-0.24.tar.gz (2.8 MB view details)

Uploaded Source

Built Distributions

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

pykakasi-0.24-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

pykakasi-0.24-py2-none-any.whl (2.8 MB view details)

Uploaded Python 2

File details

Details for the file pykakasi-0.24.tar.gz.

File metadata

  • Download URL: pykakasi-0.24.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pykakasi-0.24.tar.gz
Algorithm Hash digest
SHA256 687728778e5abb32ebe2585703175bf1d05a5884f5fb66ef2e65621a326fecfb
MD5 e84248d54e82b4997315a417f30199c5
BLAKE2b-256 c350315335c50e6934b7e7f5efadb5c850030f7919ac23418c96ba50e703de0e

See more details on using hashes here.

File details

Details for the file pykakasi-0.24-py3-none-any.whl.

File metadata

File hashes

Hashes for pykakasi-0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 80f5efec876d9d5aa69d424b030e513b340cc52666bc2fabebc7647d65474e01
MD5 4cc1f79308e2a97b440a0094a2c83744
BLAKE2b-256 e879116b9ed996fc964dc1f11f0359547d61988217f6e12ed90c509059679ff5

See more details on using hashes here.

File details

Details for the file pykakasi-0.24-py2-none-any.whl.

File metadata

File hashes

Hashes for pykakasi-0.24-py2-none-any.whl
Algorithm Hash digest
SHA256 ab34168672f538b65a447d24aea11e058b5c7e1989b3c7fd4e40036359161a40
MD5 bc261eaa2aeb98db7650b8d46ad1fa26
BLAKE2b-256 43da235312669d862a5a64e7427fafaf7abfad9bfa41d5ac31003898057d8ab1

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