Modeling a word list as both a ternary search tree and a trie for use in autocomplete, spellcheck, and autocorrect functionalities