logicaffeine_language/
ontology.rs1use crate::lexicon::Sort;
8
9include!(concat!(env!("OUT_DIR"), "/ontology_data.rs"));
10
11pub fn find_bridging_wholes(part_noun: &str) -> Option<&'static [&'static str]> {
14 let wholes = get_possible_wholes(&part_noun.to_lowercase());
15 if wholes.is_empty() {
16 None
17 } else {
18 Some(wholes)
19 }
20}
21
22pub fn check_sort_compatibility(predicate: &str, subject_sort: Sort) -> bool {
25 match get_predicate_sort(&predicate.to_lowercase()) {
26 Some(required) => subject_sort.is_compatible_with(required),
27 None => true,
28 }
29}
30
31pub fn required_sort(predicate: &str) -> Option<Sort> {
33 get_predicate_sort(&predicate.to_lowercase())
34}