MeCab Text Cleaner
This is a simple Python package for getting japanese readings (yomigana) and accents using MeCab. Please also consider using pyopenjtalk (no accents) or pyopenjtalk_g2p_prosody (ESPnet) (with accents), as this package does not account for accent changes in compound words.
Installation
Install this via pip or pipx (or your favourite package manager):
pipx install mecab-text-cleaner[unidecode,unidic]
pip install mecab-text-cleaner[unidecode,unidic]
Usage
> mtc いい天気ですね。
イ]ー テ]ンキ デス ネ。
> mtc いい天気ですね。 --ascii
i] te]nki desu ne.
> mtc いい天気ですね --no-add-atype --no-add-blank-between-words
イーテンキデスネ
> mtc いい天気ですね --no-add-atype --no-add-blank-between-words -r kana
イイテンキデスネ
from mecab_text_cleaner import to_reading, to_ascii_clean
assert to_reading(" 空、雲。\n雨!(") == "ソ]ラ、 ク]モ。\nア]メ!("
assert to_ascii_clean(" 한空、雲。\n雨!(") == "han so]ra, ku]mo. \na]me!("
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Metadata
Release files for mecab-text-cleaner 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mecab_text_cleaner-0.1.1.tar.gz | 9.7 kB | Without provenance | Details for mecab_text_cleaner-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mecab_text_cleaner-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for mecab_text_cleaner-0.1.1-py3-none-any.whl |
Total release size: 18.6 kB
Release files / mecab_text_cleaner-0.1.1.tar.gz
| Download URL | mecab_text_cleaner-0.1.1.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f56cb65a3ce0f55801ed0323f9070a2fca6c58e257be84758391fc264b94bf8
|
|
BLAKE2b-256 checksum How to use checksums |
dd9d9aa8b4eead8a3b3c2f8f8cbdf3774b727ea3bd9fac673b45e6f26f1b4fdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / mecab_text_cleaner-0.1.1-py3-none-any.whl
| Download URL | mecab_text_cleaner-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7e87ed974daeb50184c55e8fc25fc3d0bb4e1949a534eb1116b1bb12c8eff1f
|
|
BLAKE2b-256 checksum How to use checksums |
3151da52e56d0647889f3699159168873f9bcf7125cf7eec48854a770b7dc9c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for mecab-text-cleaner 0.1.1
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.