Skip to main content

Module dictionary_manager

Module dictionary_manager 

Source
Expand description

OpenJTalk dictionary download manager.

Automatically searches for or downloads the OpenJTalk UTF-8 dictionary (MeCab binary format), mirroring the C++ openjtalk_dictionary_manager.c behavior.

Note: This module downloads the OpenJTalk MeCab-format dictionary which is used by C++ and C# implementations. The Rust jpreprocess library uses a different binary format (lindera). When the naist-jdic feature is enabled (default), jpreprocess bundles its own dictionary and this module is not used for Japanese phonemization. This module is primarily used by the C# CLI’s DictionaryManager equivalent.

§Dictionary search order

  1. OPENJTALK_DICTIONARY_PATH environment variable
  2. Executable-relative: <exe_dir>/../share/open_jtalk/dic
  3. System paths (platform-dependent)
  4. Data directory: <data_dir>/open_jtalk_dic_utf_8-1.11

§Control flags

  • PIPER_OFFLINE_MODE=1 — disable all downloads
  • PIPER_AUTO_DOWNLOAD_DICT=0 — disable dictionary auto-download

Functions§

ensure_dictionary
Ensure the OpenJTalk dictionary is available, downloading if necessary.
find_dictionary
Search for an existing OpenJTalk dictionary without downloading.