Skip to content
Convert Alphabet to Phonetic Code in English and Japanease.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
a2pcej
tests
.codeclimate.yml
.coveragerc
.gitignore
.travis.yml
LICENSE.txt
README.md
README.rst
setup.cfg
setup.py
tox.ini

README.md

a2pcej

Code Climate Issue Count Coverage Status Latest Version

a2pcej, convert Alphabet to Phonetic Code in English and Japanease.

This module convert each alphabet letters to phonetic code, and also convert each alphabet letterts to katakana.

Functions

conv_al(letters, delimiter='-', upper_sign='(CAPS)', num=False)

letters is string.

def conv_al(letters, delimiter='-', sign='(CAPS)', num=False):
    return <unicode>

conv_ak(letters, delimiter='・', upper_sign='(大文字)', num=False)

letters is string.

def conv_ak(letters, delimiter='', sign='(大文字)', num=False):
    return <unicode>

Simple example of usage as below... (on Python3.5)

First of all, import module.

Import module.
>>> from a2pcej import *

Convert 'examples' to Ponetic code in English.

>>> conv_al('examples')
'Echo-Xray-Alfa-Mike-Papa-Lima-Echo-Sierra'

Convert 'examples' to Ponetic code in Japanese Katakana.

>>> conv_ak('examples')
'イー・エクス・エイ・エム・ピー・エル・イー・エス'

Non alphabet letters are not convert (default).
Upper case lattters has (CAPS) or (大文字) sign (default).

>>> conv_al('Examples002')
'Echo(CAPS)-Xray-Alfa-Mike-Papa-Lima-Echo-Sierra-0-0-2'
>>> conv_ak('Examples002')
'イー(大文字)・エクス・エイ・エム・ピー・エル・イー・エス・0・0・2'

You can change delimiter and Upper case letters sign.

>>> conv_al('Examples003', delimiter=', ', sign='(CAPITAL)')
'Echo(CAPITAL), Xray, Alfa, Mike, Papa, Lima, Echo, Sierra, 0, 0, 3'
>>> conv_ak('Examples003', delimiter='', sign='(大)')
'イー(大)/エクス/エイ/エム/ピー/エル/イー/エス/0/0/3'

If you would like to convert numbers to phonetic code, set num=True.

>>> conv_al('Examples004', num=True)
'Echo(CAPS)-Xray-Alfa-Mike-Papa-Lima-Echo-Sierra-zero-zero-four'
>>> conv_ak('Examples004', num=True)
'イー(大文字)・エクス・エイ・エム・ピー・エル・イー・エス・ゼロ・ゼロ・ヨン'
You can’t perform that action at this time.