🦙 An alpaca in the cloud native era @skygate_tech. 🥋The 12th Yahoo! Japan black belt engineer. ☸️ Author of books on Kubernetes. ⚠️ Opinions are my own.
Lindera v7.0.0 is out!
Lindera is a morphological analysis library written in Rust, also available as a CLI and through bindings for Python, Node.js, Ruby, PHP and WASM. v7.0.0 is a major release that revises the segmentation rules and, above all, rebuilds the handling of words that are not in the dictionary (unknown words). It contains breaking changes, so please read the migration guide before upgrading.
■ Revised segmentation rules
• Whitespace is skipped, and the words on either side connect directly. IPADIC now reads が in "Google が 新しい" as a case particle. Text without whitespace segments as before
• The context is carried across 、 and 。. IPADIC reads ああ in "彼は、ああ言った" as an adverb
• Revised: how equal-cost candidates are chosen, how dashes and wave dashes are handled (IPADIC no longer splits "CD―ROM"), and the N-best results
• IPADIC: the conjugation type and conjugation form fields are no longer swapped
■ Better unknown-word handling
• Candidates are created at every position, so a word in front of a run of one character type is no longer swallowed (IPADIC splits "それが「⁂⁂第一だ" into 「 and ⁂⁂)
• Candidates come from a character's default category, and characters that share a category are grouped. ko-dic gives 三國史記 and 二〇二六年 as one word each
• Overlapping char.def lines are resolved by the last line: "GUÐMUNDUR さん" gives GUÐMUNDUR / さん instead of GU / MUNDUR / さん
• ・ breaks unknown words (レノン・ジョン gives レノン / ・ / ジョン). The break characters can be changed with break_characters
• Fixed broken output on long runs of one character type
• lindera train uses the same unknown words as tokenizing does
■ Dictionaries
• New official dictionaries: UniDic CWJ / CSJ (NINJAL's UniDic for contemporary written and spoken Japanese, ver.2025.12), with 33 fields per entry, including the kana forms and the accent. Embed them with embed-unidic-cwj etc., or get them with lindera download (not in WASM)
• SudachiDict is built with Sudachi's own char.def, and the escapes in its lexicons are decoded: 3,723 entries such as http:// and 1,2塁 now match
• CC-CEDICT: Lindera revised its costs, so runs of Latin letters, kana and digits (The, Python, カラオケ, 8800) stay one word
• Jieba: its costs are trained again on UD Chinese GSD, and segmentation F1 rises from 77.31 to 87.71
• embed-* builds from https://t.co/eX0Qi9BbnW embed the dictionary published with the release, checked by SHA-256
■ Also new
• Tokenizing on several threads: --max-threads in the CLI, AnalysisWorkerPool in Rust, and batch methods such as tokenize_batch in the bindings, with Promise versions in Node.js
• Training: boundary F1 in a cross-validation rises from 0.590 to 0.955. The default regularization is L2 with a coefficient of 1.0
• Rust: lindera = "7" gives you both the segmenter and the analysis chain (lindera::analysis). Every lindera:: path of 6.2.0 still works
• New korean_decompound token filter, which splits Korean compounds
■ Before upgrading
• The dictionary format changed. Rebuild dictionary directories from v6.2.0 or earlier with lindera build, or download them again with lindera download (embedded and user dictionaries are not affected)
• Train your lindera train models again
• Update lindera and lindera-analysis to 7 together
• Rust 1.89 or newer is required
• Segmentation results change. The environment variable names (_FILE / _DIR) and the output of lindera tokenize -o json (every field as a string) also changed
Release notes: https://t.co/f4ZUBQb73M
Migration guide: https://t.co/qiM3S5CkKW
Docs: https://t.co/bjLruXgiym