fix(dict)!: Rename WORD_TRIE to WORD

This commit is contained in:
Ed Page 2024-12-28 21:30:07 -06:00
parent 52822b019f
commit d17a11650c
6 changed files with 57027 additions and 57027 deletions

View file

@ -61,7 +61,7 @@ impl BuiltIn {
// Not using `Status` to avoid the allocations
fn correct_word_with_dict(&self, word: UniCase<&str>) -> Option<&'static [&'static str]> {
typos_dict::WORD_TRIE.find(&word).copied()
typos_dict::WORD.find(&word).copied()
}
}

View file

@ -16,7 +16,7 @@ mod miss {
#[divan::bench(args = [unicase::UniCase::new(MISS)])]
fn trie(word: unicase::UniCase<&str>) -> Option<&'static &[&str]> {
trie_codegen::WORD_TRIE.find(&word)
trie_codegen::WORD.find(&word)
}
#[divan::bench(args = [unicase::UniCase::new(MISS)])]
@ -37,7 +37,7 @@ mod hit {
#[divan::bench(args = [unicase::UniCase::new(HIT)])]
fn trie(word: unicase::UniCase<&str>) -> Option<&'static &[&str]> {
trie_codegen::WORD_TRIE.find(&word)
trie_codegen::WORD.find(&word)
}
#[divan::bench(args = [unicase::UniCase::new(HIT)])]

File diff suppressed because it is too large Load diff

View file

@ -4,4 +4,4 @@
mod word_codegen;
pub use crate::word_codegen::WORD_TRIE;
pub use crate::word_codegen::WORD;

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@ fn codegen() {
const DICT: &[u8] = include_bytes!("../assets/words.csv");
let mut trie_content = vec![];
generate_trie(&mut trie_content, "WORD_TRIE", DICT);
generate_trie(&mut trie_content, "WORD", DICT);
let trie_content = String::from_utf8(trie_content).unwrap();
let trie_content = codegenrs::rustfmt(&trie_content, None).unwrap();
snapbox::assert_data_eq!(