Generate a "trie" automaton (a prefix tree) from a finite series, given as a file of (weighted) words.
Arguments:
<2>foo
foo
. In this case <2>foo
is read as a five-letter word.Postconditions:
Result.is_deterministic()
See also:
import vcsn
vcsn.B.trie('''foo
bar
baz''')
%%file words
hello
world
hell
word
vcsn.B.trie(filename='words')
vcsn.Q.trie('''
one
<2>two
<3>three
<13>thirteen
<30>thirty
<51>thirsty''')
vcsn.context('lat<law_char, law_char>, q').trie('''
<1>one|un
<2>two|deux
<3>three|trois
<4>four|quatre
<14>forteen|quatorze
<40>forty|quarante''')