pub struct CodegenData {
pub entity_count: usize,
pub entity_ids: &'static [&'static str],
pub entity_pos: &'static [&'static str],
pub entity_labels: &'static [&'static str],
pub entity_defs: &'static [&'static str],
pub word_index: &'static [(&'static str, &'static [u32])],
pub taxonomy: &'static [(u32, u32)],
pub mereology: &'static [(u32, u32)],
pub opposition: &'static [(u32, u32)],
pub equivalence: &'static [(u32, u32)],
pub causation: &'static [(u32, u32)],
}
impl CodegenData {
pub fn lookup(&self, word: &str) -> &'static [u32] {
match self.word_index.binary_search_by_key(&word, |(w, _)| w) {
Ok(idx) => self.word_index[idx].1,
Err(_) => &[],
}
}
}