1#[cfg(feature = "embed-jumandic")]
2pub mod embedded;
3
4pub const DICTIONARY_NAME: &str = "jumandic";
6const VERSION: &str = env!("CARGO_PKG_VERSION");
8
9pub fn get_version() -> &'static str {
15 VERSION
16}
17
18#[cfg(test)]
19mod tests {
20 use lindera_dictionary::dictionary::metadata::Metadata;
21
22 #[test]
28 fn the_schema_follows_the_columns_of_mecab_jumandic() {
29 let metadata = match Metadata::load(include_bytes!("../metadata.json")) {
30 Ok(metadata) => metadata,
31 Err(err) => panic!("failed to load metadata.json: {err}"),
32 };
33 assert_eq!(metadata.name, super::DICTIONARY_NAME);
34 let schema = &metadata.dictionary_schema;
35 for (index, field) in [
36 "surface",
37 "left_context_id",
38 "right_context_id",
39 "cost",
40 "part_of_speech",
41 "part_of_speech_subcategory_1",
42 "conjugation_type",
43 "conjugation_form",
44 "base_form",
45 "reading",
46 "semantic_information",
47 ]
48 .into_iter()
49 .enumerate()
50 {
51 assert_eq!(schema.get_field_index(field), Some(index), "{field}");
52 }
53 }
54}