unidic-lite

A pip-installable, trimmed-down UniDic 2.1.2 Japanese dictionary for MeCab-based tokenizers.

Library
PyPI
v1.0.8
52stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
24/100Needs Attention
Development Activity0
Maintenance0
Community24
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
29/100Needs Attention
Architecture30
Code Quality15
Innovation45
Learning Curve25

unidic-lite packages a reduced build of UniDic 2.1.2 — a standard Japanese morphological dictionary — so it can be installed with a plain pip install instead of a separate manual download. It exists because the full UniDic release is too large to ship on PyPI; this variant keeps the dictionary small enough for that limit while patching a handful of known gaps in the 2013-era source data (missing 令和-era entries, spurious single-character noun readings, and unknown-punctuation tagging).

The package itself does almost nothing at runtime: it locates the bundled dicdir/ directory and exposes its path and version string as DICDIR and VERSION. Those two values are consumed by a MeCab wrapper such as fugashi or mecab-python3, which does the actual tokenization. unidic-lite is a dependency of convenience for Japanese NLP setups, not a tool used directly.

What You Get

  • A complete UniDic 2.1.2 dictionary (matrix, connection costs, entry data) in MeCab binary format, installed automatically via pip install unidic-lite
  • A DICDIR constant pointing at the installed dictionary directory, for MeCab wrappers to consume directly
  • A VERSION constant read from the bundled dictionary’s version file, for compatibility checks
  • A handful of patches over the stock 2013 UniDic release: added 令和 (Reiwa era) entries, removed spurious single-character numeric/alphabetic word entries, and corrected unknown-punctuation tagging

Common Use Cases

  • Installing a working Japanese dictionary for fugashi or mecab-python3 without a separate manual download step
  • Running Japanese tokenization in CI/CD or Docker images where a scripted, dependency-only install is required
  • Prototyping Japanese NLP pipelines quickly, before deciding whether a larger, more current UniDic build (via the sibling unidic package) is needed
  • Distributing small Japanese-language demos or tools that need to embed a dictionary without external asset downloads

Under The Hood

Architecture The package’s real payload isn’t code — it’s roughly 250MB of MeCab-format dictionary binary data placed under unidic_lite/dicdir/ at install time. The Python surface is two files: unidic.py, which reads a version text file out of dicdir/ and returns it, and __init__.py, which re-exports that value plus the dicdir path as DICDIR/VERSION. There’s no other execution path, no classes, and no abstractions to speak of; downstream MeCab wrappers import those two constants to locate and load the dictionary themselves.

Tech Stack Packed with plain setuptools/distutils.core.setup in setup.py, with zero runtime Python dependencies — the only “dependency” is the UniDic 2.1.2 binary archive from the National Institute for Japanese Language and Linguistics, repackaged wholesale into the wheel via package_data. There’s no build step beyond sdist/bdist_wheel, no CI configuration in the repo, and no application framework of any kind — it’s a static-data distribution wrapped in a minimal Python package.

Code Quality No test files exist anywhere in the repository. The entire source is a 13-line module and a 1-line __init__.py, so there is little logic to test; there’s also no linter or formatter configuration and no type annotations. Quality here is better assessed as “does the bundled dictionary data match its documented source” than as conventional code quality, and the repo offers no automated verification of that either.

API Design The developer experience is deliberately minimal: pip install unidic-lite, then import unidic_lite for DICDIR/VERSION, with no configuration or setup calls required — most users never interact with the package directly since fugashi and mecab-python3 do it for them. The tradeoff is that it ships a large, frozen 2013 dictionary snapshot rather than the current UniDic release, so it favors install simplicity over being up to date or compact.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search