mod ir;
mod locale;
mod yomitan;
pub(crate) use ir::get_reading;
use crate::{
cli::{LangSpecs, MainArgs, Options},
dict::{Dictionary, LabelledYomitanEntries, Langs},
models::kaikki::WordEntry,
};
#[derive(Debug, Clone, Copy)]
pub struct DMain;
impl Dictionary for DMain {
type I = ir::Tidy;
type A = MainArgs;
fn skip_if(&self, entry: &WordEntry) -> bool {
ir::should_skip_entry(entry)
}
fn preprocess(&self, langs: Langs, entry: &mut WordEntry, opts: &Options, irs: &mut Self::I) {
ir::preprocess_main(langs.edition, langs.source, opts, entry, irs);
}
fn process(&self, langs: Langs, entry: &WordEntry, irs: &mut Self::I) {
ir::process_main(langs.edition, langs.source, entry, irs);
}
fn found_ir_message(&self, langs: LangSpecs, irs: &Self::I) {
ir::found_ir_message_impl(langs, irs);
}
fn write_ir(&self) -> bool {
true
}
fn postprocess(&self, irs: &mut Self::I) {
ir::postprocess_main(irs);
}
fn to_yomitan(&self, langs: LangSpecs, irs: Self::I) -> Vec<LabelledYomitanEntries> {
yomitan::to_yomitan_impl(langs, irs)
}
}