Registry / data / unidic-lite

unidic-lite

JSON →
library1.0.8pypypi✓ verified 86d ago

unidic-lite is a small version of UniDic, a Japanese morphological analysis dictionary, packaged for Python. It is designed to be installable directly via pip without requiring additional downloads, unlike the larger 'unidic' package. It uses UniDic 2.1.2 from 2013 and occupies approximately 250MB of disk space after installation. The current version is 1.0.8, released in January 2021, and its release cadence is infrequent as it primarily serves as a static dictionary resource.

pip install unidic-lite
INSTALL
IMPORT
SIG · UNIDIC-LITE
U
unidic-lite
datapythonv1.0.8
Install
10.9s avg
Import
Disk
265MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 267.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 10.9s · import 0.000s · 268MB
265MB installed
● package 265MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DICDIR
import unidic_lite; print(unidic_lite.DICDIR)
unidic-lite exposes the dictionary directory path via DICDIR. It does not provide classes for direct morphological analysis.

This quickstart demonstrates how to use `unidic-lite` with the `fugashi` library, a common MeCab wrapper. `unidic-lite.DICDIR` provides the path to the installed dictionary, which must be passed to the `Tagger` initialization.

import unidic_lite from fugashi import Tagger # unidic-lite needs to be explicitly passed to the Tagger tagger = Tagger(f'-d "{unidic_lite.DICDIR}"') text = "すもももももももものうち" # Analyze the text words = [] for word in tagger(text): words.append(f'{word.surface}\t{word.feature.pos1}\t{word.feature.lemma}') print('\n'.join(words))
Debug
Known issues
gotchaunidic-lite is solely a dictionary resource. To perform Japanese morphological analysis, a separate MeCab wrapper library like `fugashi` or `mecab-python3` must be installed and used in conjunction with unidic-lite.
fix
Install a MeCab wrapper (e.g., `pip install fugashi`) and pass `unidic_lite.DICDIR` to its Tagger constructor.
affects: All
gotchaDespite 'lite' in its name, unidic-lite requires approximately 250MB of disk space for the dictionary data after installation.
fix
Ensure sufficient disk space is available before installation. Consider using `unidic-lite-imitator` for significantly smaller footprint if suitable.
affects: All
gotchaunidic-lite is based on UniDic 2.1.2 from 2013. This older version may lack vocabulary for modern terms and phrases compared to the full `unidic` package (which uses UniDic 3.1.0 and is much larger).
fix
For the most up-to-date dictionary, consider using the `unidic` package (requires a separate download step and more disk space) or explore alternatives.
affects: All
gotchaThe unidic-lite dictionary has minor modifications from the official UniDic release, including added entries for '令和', removal of single-character numeric and alphabetic words, and changes to `unk.def`. These might lead to slightly different tokenization results compared to an unmodified UniDic.
fix
Be aware of these differences; if strict adherence to official UniDic behavior is required, review the specific changes or use an unmodified UniDic distribution.
affects: All
gotchaUsers frequently encounter 'Failed initializing MeCab' errors when using MeCab wrappers with unidic-lite. This often stems from the wrapper failing to locate the dictionary or underlying MeCab installation issues (e.g., missing C++ redistributables on Windows).
fix
Always explicitly pass `unidic_lite.DICDIR` to the MeCab Tagger constructor (as shown in quickstart). For persistent issues, consult the MeCab wrapper's documentation, ensure MeCab is correctly installed on your system, and check system-specific dependencies.
affects: All
Errors
Common errors & fixes
fugashi.fugashi.MeCabError: Tagger new error: failed to load dictionary.
The `fugashi` library, which relies on MeCab, failed to find or load the `unidic-lite` dictionary files required for tagger initialization.
fix
Ensure `unidic-lite` is installed and explicitly provide the dictionary path to `fugashi.Tagger`: `import fugashi; import unidic_lite; tagger = fugashi.Tagger(unidic_lite.DICDIR)`
ModuleNotFoundError: No module named 'unidic_lite'
The `unidic-lite` package is not installed in the current Python environment or is not accessible from where the code is being executed.
fix
Install the package using pip: `pip install unidic-lite`
FileNotFoundError: [Errno 2] No such file or directory: '.../site-packages/unidic_lite/dic/sys.dic'
A program attempting to use `unidic-lite` cannot locate specific dictionary files due to an incomplete installation, a corrupted virtual environment, or an incorrect path assumption by a dependent library.
fix
Reinstall `unidic-lite` in a clean Python environment to ensure all dictionary files are correctly placed. If using a library that allows specifying the dictionary path, provide `unidic_lite.DICDIR`.
Upgrade
Version history
1.0.8latest on PyPI · released Jan 25, 2021
Audit
Dependencies
fugashirequiredRequired to use the UniDic dictionary for Japanese morphological analysis; unidic-lite only provides the dictionary data.
mecab-python3requiredAlternative to fugashi; a Python wrapper for MeCab, necessary to perform morphological analysis using the unidic-lite dictionary.
Agent activity
63 hits · last 30 days
node
56
Amazon
1
OpenAI (training)
1
Resources