Trie implementation for fast text processing