You're building a lookup cache .. there are many ways to do it -- I agree that using a hash is the best way. That being said, depending on how often you'll be using this logic, you might want to think about figuring out whether you load the hash every time you do a search, and how often you re-load, when new words are added. You could freeze and thaw your hash to improve start-up performance. You could even see if loading the words into a database (perhaps using sqlite3) would be a better solution. It's all a balancing act between performance and ease of use (when updating).
Actually, that's also a pretty cool interview question. :)
In reply to Re: Filtering out stop words
by talexb
in thread Filtering out stop words
by IB2017
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |