Skip to main content

jaconv

travis-ci.org coveralls.io downloads pyversion latest version license

jaconv (Japanese Converter) はひらがな・カタカナ・全角・半角の文字種変換を高速に行います。 Pythonのみで実装されているので、Cコンパイラが使えない環境でも利用できます。

normalizeメソッドは、unicodedata.normalize を日本語処理向けに特化した拡張を行っています。 具体的には以下のように変換します。

u'〜' -> u'ー',
u'~' -> u'ー',
u"’" -> "'",
u'”' -> '"',
u'―' -> '-',
u'‐' -> '-'

INSTALLATION

$ pip install jaconv

USAGE

import jaconv
jaconv.hira2kata(u'ともえまみ')
# => u'トモエマミ'
jaconv.hira2hkata(u'ともえまみ')
# => u'トモエマミ'
jaconv.kata2hira(u'巴マミ')
# => u'巴まみ'
jaconv.h2z(u'ティロ・フィナーレ')
# => u'ティロ・フィナーレ'
jaconv.h2z(u'abc', ascii=True)
# => u'abc'
jaconv.h2z(u'123', digit=True)
# => u'123'
jaconv.h2z(u'アabc123', kana=False, digit=True, ascii=True)
# => u'アabc123'
jaconv.z2h(u'ティロ・フィナーレ')
# => u'ティロ・フィナーレ'
jaconv.z2h(u'abc', ascii=True)
# => u'abc'
jaconv.z2h(u'123', digit=True)
# => u'123'
jaconv.z2h(u'アabc123', kana=False, digit=True, ascii=True)
# => u'アabc123'
jaconv.normalize(u'ティロ・フィナ〜レ', 'NFKC')
# => u'ティロ・フィナーレ'

CHANGES

0.2 (2015-04-02)

  • Change module name jctconv -> jaconv

  • Add alphabet and hiragana interconvert (alphabet2kana, kana2alphabet)

0.1.1 (2015-03-12)

  • Support Windows

  • Support Python 3.5

0.1 (2014-11-24)

  • Add some Japanese characters to convert table (ゝゞ・「」。、)

  • Decresing memory usage

  • Some function names are deprecated (hankaku2zenkaku, zenkaku2hankaku, H2K, H2hK, K2H)

0.0.7 (2014-03-22)

z2h and h2z allow mojimoji-like target character type determination. Bug fix about Half Kana conversion.

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.1

2 files

0.4.0

1 file

0.3.4

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

This release

0.2 This release

0.2.0

1 file

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