Skip to main content

mozcpy

pyversion latest version license

Mozc dictionary reader 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
# => ['もう なに も こわく ない']

converter.search_prefix("まどかま", n_best=1)
# => ['まどかマギカ']

converter.dict_version()  # version of included dictionary (Mozc repository's tag)
# => '3.34.6239'

NOTE

The author has no affiliation whatsoever with Google. Furthermore, the mozcpy is an unofficial project.

FOR DEVELOPER

This module uses Git LFS to pull dictionary files.

ACKNOWLEDGEMENT

This module relies on Mozc and MeCab.

  • T. 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.

  • T. 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.3.0 (2026-10-19)

  • Add search_prefix method

  • Add dict_version method

  • Support Python 3.13, 3.14 and 3.15

  • Update the dictionaries

0.2 (2023-12-12)

  • Update the dictionaries

  • Fix Windows MeCab args problem (thanks @Bye-lemon)

  • Support Python 3.11 and 3.12

0.1.1 (2023-01-06)

-Fix install problem

0.1 (2022-08-22)

  • First release

Metadata

Release files for mozcpy 0.3.0

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

Source distribution (sdist)

Source distribution for mozcpy 0.3.0
File Size Uploaded Provenance Actions
mozcpy-0.3.0.tar.gz 32.2 MB Without provenance Details for mozcpy-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mozcpy 0.3.0
File Interpreter ABI Platform Actions
mozcpy-0.3.0-py3-none-any.whl Python 3 none any Details for mozcpy-0.3.0-py3-none-any.whl

Total release size: 64.4 MB

Release files / mozcpy-0.3.0.tar.gz

Download URL mozcpy-0.3.0.tar.gz
Size 32.2 MB
Tags Source
SHA-256 checksum
How to use checksums
5d646bd85bf4a0c2cbc44ac322ffad0e0ca73b97aeaf09929f131837469f4695
BLAKE2b-256 checksum
How to use checksums
a1877946a50bfa0e62c428316bd41a27c05ca55c1294d56a7b1a43d218462ffa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.19

Release files / mozcpy-0.3.0-py3-none-any.whl

Download URL mozcpy-0.3.0-py3-none-any.whl
Size 32.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e21ef6fa5a7c520e22a618edf119cb67f9b6b78f76790b68b14526401e799db3
BLAKE2b-256 checksum
How to use checksums
44434c1974add0a408ffca5871066785f13d5b8ca764c2e0b7e460a1c056f344
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.19

Security for mozcpy 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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