1use pyo3::prelude::*;
2
3pub mod mecab;
4pub mod rsc;
5
6const SRC_JSON: &'static [u8] = include_bytes!("rsc/rsc.json");
7const MECAB_DIC: &'static str = "unidic-cwj-3_1_1+compact-dual/system.dic.zst";
8const MECAB_USER_DIC: &'static str = include_str!("mecab/dic/user_dic.csv");
9
10#[pymodule(name = "keywords")]
11fn keywords(m: &Bound<'_, PyModule>) -> PyResult<()> {
12 m.add_class::<rsc::Language>()?;
13 m.add_class::<rsc::Category>()?;
14 m.add_class::<rsc::Keyword>()?;
15 m.add_function(wrap_pyfunction!(rsc::load_keywords, m)?)?;
16 m.add_function(wrap_pyfunction!(rsc::load_keywords_from_rsc, m)?)?;
17 m.add_function(wrap_pyfunction!(rsc::extract_keywords, m)?)?;
18 Ok(())
19}