# polynomial.trie¶

Generate a "trie" automaton (a prefix tree) from a finite series, given as a polynomial of words.

Postconditions:

• Result.is_deterministic()
• Result = p.trie.shortest(N) for a large enough N.

Properties:

• The support of result is isomorphic to the support of determinized standard automaton built from the polynomials seen as a rational expression, however weights are not placed at the same locations.

## Examples¶

In [1]:
import vcsn


### Boolean weights (finite language)¶

In [2]:
language = '\e+a+b+abc+abcd+abdc'

b = vcsn.context('lal_char, b')
B = vcsn.context('law_char, b')

B.polynomial(language).trie()

Out[2]:
In [3]:
b.expression(language).standard().determinize().strip()

Out[3]:

### Weighted polynomials of words (finite series)¶

In [4]:
series = '<2>\e + <3>a + <4>b + <5>abc + <6>abcd + <7>abdc'

q = vcsn.context('lal_char, z')
Q = vcsn.context('law_char, z')

Q.polynomial(series).trie()

Out[4]:
In [5]:
q.expression(series).standard().determinize().strip()

Out[5]: