问题
i just construct a trie for a vocabulary, and then I found that there are many branches shared the same struct. i want to combine them together result to be a DAWG.
What algorithm would I use to convert a trie to a DAWG?
回答1:
The standard algorithm for converting a trie into a DAWG works by treating the trie as a deterministic finite automaton, then converting the trie into a minimum-state DFA.
There are many algorithms for performing this conversion. The algorithm I'm most familiar with is Hopcroft's algorithm, which works by finding pairs of distinguishable states and combining indistinguishable states together.
Hope this helps!
来源:https://stackoverflow.com/questions/15825543/how-to-construct-a-dawg-from-a-trie