Installation
lindera-dependency is on crates.io from Lindera 7.1.0 on. Most programs do not depend on it directly: they use the token filter japanese_dependency of the Lindera tokenizer, which the lindera crate, the lindera command and the bindings carry.
In a tokenizer
The filter is behind the dependency feature of lindera:
[dependencies]
lindera = { version = "7.1", features = ["dependency"] }
The lindera command and the bindings (Python, Node.js, Ruby, PHP, WebAssembly) have the feature in their default builds, from 7.1.0 on: the packages you install have the filter. See Token Filter, and the installation page of each: command, Python, Node.js, Ruby, PHP, WebAssembly.
A build of the command without the default features knows the name of the filter and says what is missing:
Error: LinderaError { kind: FeatureDisabled, source: the token filter japanese_dependency needs a build with the feature `dependency` }
The crate
[dependencies]
lindera-dependency = "7.1"
The default build has no dependency and builds for wasm32-unknown-unknown: it takes any sequence of morphemes, from Lindera or not. The feature flags add the training and the embedded model.
The crate is a library. Its command, which parses plain text and writes the lattice format, is lindera dependency, a part of the lindera command, in its default build:
cargo install lindera-cli
The model
The analysis needs a model file for the dictionary of the tokenizer. Lindera publishes four with each release: one for IPADIC (The model for IPADIC) and one for each of unidic, unidic-cwj and unidic-csj (The models for UniDic). A model is not part of a package or of a crate, as the dictionaries are not. There are three ways to get one, shown here for IPADIC; for a UniDic dictionary, its name takes the place of ipadic:
lindera dependency download ipadicinstalls the model of the version of the command, and prints the path of the model file (download).lindera-dependency-ipadic-<version>.zip, on the page of a release, holds the model filedependency.modeland itsNOTICE.txt.- The feature
embed-dependency-ipadicoflindera, of the command and of the bindings (embed-model-ipadicoflindera-dependency) embeds it in the build (Embedding it).
The model is under the MIT license, and comes with a notice (License of the model).