Manage custom dictionaries via TXT files
masterYou can add custom dictionaries to zhparser by placing files in the share/tsearch_data directory. zhparser supports .txt (text) and .xdb (binary) formats.
TXT Dictionary Format
Each line represents one record with up to 4 fields separated by spaces or tabs:
词语 (Word) | TF | IDF | 词性 (Part of Speech)
- Comments: Lines starting with
#or;are ignored. - Defaults: If
TFandIDFare omitted, they default to1.0. If词性is omitted, it defaults to@. - Deletion: To mark a word as invalid (even if it exists in core libraries), set its part of speech to
!. - Priority: Multiple dictionaries in
zhparser.extra_dictsare processed in order of increasing priority (left to right).