jpreprocess/dictionary/
kind.rs

1use lindera_dictionary::dictionary::Dictionary;
2
3/// Specifies the kind of self-contained dictionary used for tokenization and preprocessing.
4pub enum JPreprocessDictionaryKind {
5    #[cfg(feature = "naist-jdic")]
6    NaistJdic,
7}
8
9impl JPreprocessDictionaryKind {
10    pub(crate) fn load(&self) -> Dictionary {
11        match &self {
12            #[cfg(feature = "naist-jdic")]
13            Self::NaistJdic => jpreprocess_naist_jdic::lindera::load().unwrap(),
14
15            #[allow(unreachable_patterns)]
16            _ => unreachable!(),
17        }
18    }
19}