2020-05-27 21:46:41 -04:00
|
|
|
mod vars_codegen;
|
|
|
|
|
|
|
|
pub use crate::vars_codegen::*;
|
|
|
|
|
|
|
|
pub use varcon_core::Category;
|
|
|
|
pub use varcon_core::CategorySet;
|
2021-05-31 22:29:39 -04:00
|
|
|
|
|
|
|
pub fn find(word: &'_ unicase::UniCase<&str>) -> Option<&'static [(u8, &'static VariantsMap)]> {
|
|
|
|
VARS_DICTIONARY
|
2021-05-31 22:29:39 -04:00
|
|
|
.binary_search_by_key(word, |(key, _)| key.convert())
|
2021-05-31 22:29:39 -04:00
|
|
|
.map(|i| VARS_DICTIONARY[i].1)
|
|
|
|
.ok()
|
|
|
|
}
|
2021-05-31 22:29:39 -04:00
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug)]
|
|
|
|
pub(crate) enum EncodedStr {
|
|
|
|
//Unicode(&'static str),
|
|
|
|
Ascii(&'static str),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl EncodedStr {
|
|
|
|
fn convert(self) -> unicase::UniCase<&'static str> {
|
|
|
|
match self {
|
|
|
|
//EncodedStr::Unicode(s) => unicase::UniCase::unicode(s),
|
|
|
|
EncodedStr::Ascii(s) => unicase::UniCase::ascii(s),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|