method for autocomplete trie filling