Skip to main content

About

This library identifies (kenchi) romanized Japanese family names (myouji), largely in order to split romanized Japanese names into given name and family name.

Usage

>>> import myouji_kenchi
>>> myouji_kenchi.order_names(['Yamada', 'Satoshi'])
['Satoshi', 'Yamada']
>>> myouji_kenchi.get_score_as_myouji('Yamada')
201046.0
>>> myouji_kenchi.get_score_as_myouji('Satoshi')
329.0
>>> transliterator = myouji_kenchi.MyoujiBackTransliteration()
>>> transliterator.back_transliterate('Yamada')
[('ヤマダ', 201046.0)]

Background

The Japanese ordering of a name is family name given name, whereas the Western ordering is given name family name. When a name is written in Japanese script one can assume it follows that convention. However, when a Japanese name is written in Latin characters it might be in either order, depending on the context and the author. While sometimes a person's name can be treated as atomic, it is often desirable to know which name is which.

One major complication is the variety of romanization schemes in active use. Most libraries for back transliterating from Latin characters to Japanese script presuppose that the romanization scheme for the original transliteration is known. Often in the sort of situation where you do not know the order of a Japanese name the romanization scheme will also be unknown. This library targets Kunrei-shiki, Nihon-shiki, and (Modified) Hepburn, with allowance for the common deviations of omitting macrons and apostrophes.

Installation/Dependencies

  1. Install OpenFst.

    It is necessary that the version of OpenFst and the version of the OpenFst Python binding match. Note that OpenFst must be compiled with the --enable-far option in order to support that binding package.

    wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.6.6.tar.gz
    tar xf openfst-1.6.6.tar.gz
    cd openfst-1.6.6
    ./configure --enable-far
    make
    sudo make install 
    
  2. Pip install myouji-kenchi

    pip install myouji-kenchi
    

Compiling OpenFst on OS X can be troublesome. Making sure you have the latest version of your compiler and prefixing pip install and/or make with CFLAGS="-std=c++11 -stdlib=libc++" can be helpful.

For Python dependencies see setup.py and requirements_dev.txt.

License

MIT License (see LICENSE file)

Release files for myouji-kenchi 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for myouji-kenchi 1.0.1
File Size Uploaded
myouji_kenchi-1.0.1.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for myouji-kenchi 1.0.1
File Interpreter ABI Platform
myouji_kenchi-1.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 409.1 kB

Release files / myouji_kenchi-1.0.1.tar.gz

Download URL myouji_kenchi-1.0.1.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9e82343dd98c001883321b3be4e52ce1cbcf37e0560e32f950e16fe7e88ad6e4
BLAKE2b-256 checksum
How to use checksums
40dad721a686b2694426ffff561ad70915606888a27307127ac026d3dd7bf707
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / myouji_kenchi-1.0.1-py2.py3-none-any.whl

Download URL myouji_kenchi-1.0.1-py2.py3-none-any.whl
Size 401.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
92fefb72a90842b5c4d26db49c398472554300163001102eeca616569e3da1dd
BLAKE2b-256 checksum
How to use checksums
74b61f1e30e10a3b785f5006931724330cf6d97669048d30bba6d284101bb610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page