<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 polynomial.trie
Generate a "trie" automaton (a prefix tree) from a finite series, given as a polynomial of words.
Postconditions
Step1:  Boolean weights (finite language)
Step2:  Weighted polynomials of words (finite series)
<ASSISTANT_TASK:>
Python Code:
import vcsn
Explanation: 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.
See also:
- context.trie
- polynomial.cotrie
Examples
End of explanation
language = '\e+a+b+abc+abcd+abdc'
b = vcsn.context('lal_char, b')
B = vcsn.context('law_char, b')
B.polynomial(language).trie()
b.expression(language).standard().determinize().strip()
Explanation: Boolean weights (finite language)
End of explanation
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()
q.expression(series).standard().determinize().strip()
Explanation: Weighted polynomials of words (finite series)
End of explanation
<END_TASK>