Improve sampling algorithm for selecting random phrase from trie