Skip to main content

Mozc for Python: yet another Kana-Kanji converter

Project description

mozcpy

circleci coveralls.io pyversion latest version license

Mozc for Python: yet another Kana-Kanji converter

INSTALLATION

$ pip install mozcpy

USAGE

import mozcpy

converter = mozcpy.Converter()
converter.convert('まほうしょうじょ')
# => '魔法少女'
converter.convert('まほうしょうじょ', n_best=10)
# => ['魔法少女', '魔法消除', '魔法省所', '魔法小所', '魔法昇叙', '魔砲少女', 'マホウ少女', '魔法証所', '魔法賞所']

converter.convert_wakati('もうなにもこわくない')
# => 'もう 何 も 怖く ない'
converter.convert_wakati('もうなにもこわくない', n_best=3)
# => ['もう 何 も 怖く ない', 'もう 何 も こわく ない', 'もう 何 も 恐く ない']

converter.wakati("もうなにもこわくない")
# => 'もう なに も こわく ない'
converter.wakati("もうなにもこわくない", n_best=10)  # duplicatetions are ignored
# => ['もう なに も こわく ない']

ACKNOWLEDGEMENT

This module relies on Mozc and MeCab.

    1. Kudo, T. Hanaoka, J. Mukai, Y. Tabata, H. Komatsu. 2011. Efficient dictionary and language model compression for input method editors. In Proceedings of the Workshop on Advances in Text Input Methods (WTIM 2011), pp 19-25.

    1. Kudo, H. Komatsu, T. Hanaoka, A. Mukai, Y. Tabata, K. Yamamoto, Y. Matsumoto. 2004. Applying Conditional Random Fields to Japanese Morphological Analysis. In Proceedings of the EMNLP 2004, pp 230-237.

CHANGES

0.1 (2022-08-22)

  • First release

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

mozcpy-0.1.tar.gz (37.4 MB view details)

Uploaded Source

File details

Details for the file mozcpy-0.1.tar.gz.

File metadata

  • Download URL: mozcpy-0.1.tar.gz
  • Upload date:
  • Size: 37.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for mozcpy-0.1.tar.gz
Algorithm Hash digest
SHA256 77e95ff65ef35e6b7db2cd08ef57809231075090dfd23b1f5e118473ffdb45b2
MD5 66e589c971636a3d85cd52ce928ee14e
BLAKE2b-256 ce27341a61b89ad65c7c0de4449f0cd6a9723fafd908021e7dbe5bc6e9d7969e

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