From bd7c3df5db3b5e909cd959d6798ead5030033445 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 30 Dec 2024 14:22:11 -0600 Subject: [PATCH] fix(dictgen): Align trie write/access conditions --- crates/dictgen/src/trie.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/dictgen/src/trie.rs b/crates/dictgen/src/trie.rs index 0ecef04..f1ff42f 100644 --- a/crates/dictgen/src/trie.rs +++ b/crates/dictgen/src/trie.rs @@ -34,7 +34,12 @@ pub struct DictTrie { impl DictTrie { #[inline] pub fn find(&self, word: &'_ unicase::UniCase<&str>) -> Option<&'static V> { - if word.is_ascii() { + if word + .into_inner() + .as_bytes() + .iter() + .all(|b| b.is_ascii_alphabetic()) + { if self.range.contains(&word.len()) { self.find_ascii(word.as_bytes()) } else {