Okay rusaceans, I know you're out there, help me out. I want a Thing that checks if a candidate Vec<u8> is a word in the English language, and I want it to be fast. I was thinking the dictionary should be static, rather than built at runtime. How should I do this?
-
Show this thread
-
I am very much a rust beginner, so maybe static is a bad thing? I thought about using phf sets, but I end up with type mismatches because words aren't all the same length. I could make them all arrays of the same length and pad out candidates with nulls before checking?
1 reply 0 retweets 1 likeShow this thread -
Or I could store a set of hashes, and do lookups there, but it feels weird that I have to do the hashing myself. But maybe that's because I'm a newbie, and that really is the thing I should be doing.
2 replies 0 retweets 1 likeShow this thread
Replying to @mjec
I think you want a trie https://en.wikipedia.org/wiki/Trie although I don't know what Rust's support for this is like
5:11 PM - 26 Oct 2018
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.