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