Switched to JavaScript ascii regexp. Now trie is built in seconds and not hours.