
    /hY                        S SK r S SKJr  S SKJrJr  S SKJrJr   " S S\	5      r
\ " S S5      5       r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\	5      rg)    N)total_ordering)chainislice)raise_unorderable_typesslice_boundsc                   t    \ rS rSrSS jrS rS rS rS rS r	S	 r
S
 rS rSS jrS rSS jrS rS rSrg)OrderedDict   Nc                     U R                  XR                  S5      5      U l        UR                  S5      U l        Uc  [        R                  U 5        g [        R                  X5        g )Nkeysdefault_factory)r   get_keys_default_factorydict__init__)selfdatakwargss      H/var/www/auris/envauris/lib/python3.13/site-packages/nltk/collections.pyr   OrderedDict.__init__   sJ    YYtZZ%78
 &

+< =<MM$MM$%    c                 d    [         R                  X5        U R                  R                  U5        g N)r   __delitem__r   remover   keys     r   r   OrderedDict.__delitem__   s"    #

#r   c                 p     [         R                  X5      $ ! [         a    U R                  U5      s $ f = fr   )r   __getitem__KeyError__missing__r   s     r   r!   OrderedDict.__getitem__    s8    	)##D.. 	)##C((	)s    55c                 0    S U R                  5        5       $ )Nc              3   $   #    U  H  ov   M     g 7fr    ).0r   s     r   	<genexpr>'OrderedDict.__iter__.<locals>.<genexpr>'   s     +{{s   )r   r   s    r   __iter__OrderedDict.__iter__&   s    +tyy{++r   c                 v    U R                   (       d  XR                  ;  a
  [        5       eU R                  5       $ r   )r   r   r"   r   s     r   r#   OrderedDict.__missing__)   s+    $$JJ)>*$$&&r   c                     [         R                  XU5        XR                  ;  a  U R                  R                  U5        g g r   )r   __setitem__r   append)r   r   items      r   r1   OrderedDict.__setitem__.   s3    D)jj JJc" !r   c                 b    [         R                  U 5        U R                  R                  5         g r   )r   clearr   r+   s    r   r6   OrderedDict.clear3   s    

4

r   c                 R    [         R                  U 5      nU R                  Ul        U$ r   )r   copyr   )r   ds     r   r9   OrderedDict.copy7   s    IIdO**r   c                 R    [        U R                  5       U R                  5       5      $ r   )zipr   valuesr+   s    r   itemsOrderedDict.items<   s    499;..r   c                    U(       a  U(       a3  [        U[        5      (       d   e[        U5      [        U5      :X  d   eU$ [        U[        5      (       d,  [        U[        5      (       d  [        U[        5      (       d   e[        U[        5      (       d  [        U[        5      (       a  UR                  5       $ [        U[        5      (       a  U VVs/ s H  u  p4UPM	     snn$ g SU R                  ;   a  U R                  $ / $ s  snnf )Nr   )
isinstancelistlenr   r	   r   __dict__r   )r   r   r   r   values        r   r   OrderedDict.keys?   s    !$----4yCI--- tT**!$44!$--. dD))Zk-J-J99;&d++489DLSCD99 ,%::I	 :s   Dc                 ~    U R                   (       d
  [        5       eU R                   R                  5       nX   nX	 X4$ r   )r   r"   pop)r   r   rF   s      r   popitemOrderedDict.popitemT   s5    zz*jjnn	I|r   c                     [         R                  XU5        XR                  ;  a  U R                  R                  U5        g g r   )r   
setdefaultr   r2   )r   r   failobjs      r   rM   OrderedDict.setdefault]   s1    7+jj JJc" !r   c                     [         R                  X5        U R                  U5       H/  nX R                  ;  d  M  U R                  R	                  U5        M1     g r   )r   updater   r   r2   )r   r   r   s      r   rQ   OrderedDict.updateb   s<    D99T?C**$

!!#& #r   c                 B    [        U R                  U R                  5      $ r   )mapr   r   r+   s    r   r>   OrderedDict.valuesh   s    488TZZ((r   )r   r   r   NN)__name__
__module____qualname____firstlineno__r   r   r!   r,   r#   r1   r6   r9   r?   r   rJ   rM   rQ   r>   __static_attributes__r'   r   r   r	   r	      sH    &),'
#

/*#
')r   r	   c                       \ rS rSrSrS rS rS rS rS r	SS	 jr
S
 rS rS rS rS rSrS rS rS rS rS rSrg)AbstractLazySequenceq   a  
An abstract base class for read-only sequences whose values are
computed as needed.  Lazy sequences act like tuples -- they can be
indexed, sliced, and iterated over; but they may not be modified.

The most common application of lazy sequences in NLTK is for
corpus view objects, which provide access to the contents of a
corpus without loading the entire corpus into memory, by loading
pieces of the corpus from disk as needed.

The result of modifying a mutable element of a lazy sequence is
undefined.  In particular, the modifications made to the element
may or may not persist, depending on whether and when the lazy
sequence caches that element's value or reconstructs it from
scratch.

Subclasses are required to define two methods: ``__len__()``
and ``iterate_from()``.
c                     [        S5      e)zM
Return the number of tokens in the corpus file underlying this
corpus view.
!should be implemented by subclassNotImplementedErrorr+   s    r   __len__AbstractLazySequence.__len__   s    
 ""EFFr   c                     [        S5      e)z
Return an iterator that generates the tokens in the corpus
file underlying this corpus view, starting at the token number
``start``.  If ``start>=len(self)``, then this iterator will
generate no tokens.
r`   ra   r   starts     r   iterate_from!AbstractLazySequence.iterate_from   s     ""EFFr   c                    [        U[        5      (       a  [        X5      u  p#[        XU5      $ US:  a  U[	        U 5      -  nUS:  a  [        S5      e [        U R                  U5      5      $ ! [         a  n[        S5      UeSnAff = f)zy
Return the *i* th token in the corpus file underlying this
corpus view.  Negative indices and spans are both supported.
r   index out of rangeN)	rB   slicer   LazySubsequencerD   
IndexErrornextrh   StopIteration)r   irg   stopes        r   r!    AbstractLazySequence.__getitem__   s    
 a&t/KE"455 1uSY1u !566>D--a011  > !56A=>s   A/ /
B
9BB
c                 $    U R                  S5      $ )z\Return an iterator that generates the tokens in the corpus
file underlying this corpus view.r   )rh   r+   s    r   r,   AbstractLazySequence.__iter__   s       ##r   c                 .   ^ [        U4S jU  5       5      $ )z8Return the number of times this list contains ``value``.c              3   6   >#    U  H  oT:X  d  M
  S v   M     g7f)   Nr'   )r(   eltrF   s     r   r)   -AbstractLazySequence.count.<locals>.<genexpr>   s     5u11s   		)sumr   rF   s    `r   countAbstractLazySequence.count   s    5555r   Nc                     [        U [        X#5      5      u  p#[        [        XU5      5       H  u  pEXQ:X  d  M  XB-   s  $    [	        S5      e)zReturn the index of the first occurrence of ``value`` in this
list that is greater than or equal to ``start`` and less than
``stop``.  Negative start and stop values are treated like negative
slice bounds -- i.e., they count from the end of the list.zindex(x): x not in list)r   rl   	enumerater   
ValueError)r   rF   rg   rr   rq   rz   s         r   indexAbstractLazySequence.index   sJ    
 #4u);<tD 9:FA|y  ; 233r   c                 6    [        U R                  U5      5      $ )z,Return true if this list contains ``value``.)boolr~   r}   s     r   __contains__!AbstractLazySequence.__contains__   s    DJJu%&&r   c                     [        X/5      $ z,Return a list concatenating self with other.LazyConcatenationr   others     r   __add__AbstractLazySequence.__add__   s     $//r   c                     [        X/5      $ z,Return a list concatenating other with self.r   r   s     r   __radd__AbstractLazySequence.__radd__   s     %//r   c                      [        U /U-  5      $ z=Return a list concatenating self with itself ``count`` times.r   r   r~   s     r   __mul__AbstractLazySequence.__mul__        $%00r   c                      [        U /U-  5      $ r   r   r   s     r   __rmul__AbstractLazySequence.__rmul__   r   r   <   c                    / nSnU  Hj  nUR                  [        U5      5        U[        US   5      S-   -  nX R                  :  d  MB  [        U5      S:  d  MS  SSR	                  USS 5      -  s  $    SSR	                  U5      -  $ )z
Return a string representation for this corpus view that is
similar to a list's representation; but if it would be more
than 60 characters long, it is truncated.
      z	[%s, ...]z, Nz[%s])r2   reprrD   _MAX_REPR_SIZEjoin)r   pieceslengthrz   s       r   __repr__AbstractLazySequence.__repr__   s     CMM$s)$c&*o))F+++Fa"TYYvcr{%;;;	 
 		&)))r   c                 l    [        U 5      [        U5      :H  =(       a    [        U 5      [        U5      :H  $ r   )typerC   r   s     r   __eq__AbstractLazySequence.__eq__   s'    DzT%[(FT$Z4;-FFr   c                     X:X  + $ r   r'   r   s     r   __ne__AbstractLazySequence.__ne__   s      r   c                 x    [        U5      [        U 5      :w  a  [        SX5        [        U 5      [        U5      :  $ )N<)r   r   rC   r   s     r   __lt__AbstractLazySequence.__lt__   s/    ;$t*$#C5DzDK''r   c                 F    [        SU R                  R                  -  5      e)z8
:raise ValueError: Corpus view objects are unhashable.
z%s objects are unhashable)r   	__class__rW   r+   s    r   __hash__AbstractLazySequence.__hash__   s     4t~~7N7NNOOr   r'   rV   )rW   rX   rY   rZ   __doc__rc   rh   r!   r,   r~   r   r   r   r   r   r   r   r   r   r   r   r   r[   r'   r   r   r]   r]   q   sb    (GG>($
6	4'0011 N*G!(
Pr   r]   c                   6    \ rS rSrSrSr S rS rS rS r	Sr
g	)
rm      z
A subsequence produced by slicing a lazy sequence.  This slice
keeps a reference to its source sequence, and generates its values
by looking them up in the source sequence.
d   c                     X2-
  U R                   :  a&  [        [        UR                  U5      X2-
  5      5      $ [        R                  U 5      $ )z
Construct a new slice from a given underlying sequence.  The
``start`` and ``stop`` indices should be absolute indices --
i.e., they should not be negative (for indexing from the back
of a list) or greater than the length of ``source``.
)MIN_SIZErC   r   rh   object__new__)clssourcerg   rr   s       r   r   LazySubsequence.__new__  s@     <#,,&v22594<HII>>#&&r   c                 (    Xl         X l        X0l        g r   _source_start_stop)r   r   rg   rr   s       r   r   LazySubsequence.__init__  s    
r   c                 4    U R                   U R                  -
  $ r   )r   r   r+   s    r   rc   LazySubsequence.__len__  s    zzDKK''r   c           	          [        U R                  R                  XR                  -   5      [	        S[        U 5      U-
  5      5      $ Nr   )r   r   rh   r   maxrD   rf   s     r   rh   LazySubsequence.iterate_from  s:    LL%%ekk&9:C3t9uCT<U
 	
r   r   N)rW   rX   rY   rZ   r   r   r   r   rc   rh   r[   r'   r   r   rm   rm      s'     H'
(
r   rm   c                   *    \ rS rSrSrS rS rS rSrg)r   i  a  
A lazy sequence formed by concatenating a list of lists.  This
underlying list of lists may itself be lazy.  ``LazyConcatenation``
maintains an index that it uses to keep track of the relationship
between offsets in the concatenated lists and offsets in the
sublists.
c                      Xl         S/U l        g r   _list_offsets)r   list_of_listss     r   r   LazyConcatenation.__init__(  s    "
r   c                     [        U R                  5      [        U R                  5      ::  a%  U R                  U R                  S   5       H  nM     U R                  S   $ )Nr   )rD   r   r   rh   r   _s     r   rc   LazyConcatenation.__len__,  sK    t}}TZZ0&&t}}R'89 :}}R  r   c              #      #    XR                   S   :  a%  [        R                  " U R                   U5      S-
  nO[        U R                   5      S-
  nU R                   U   n[	        U R
                  [        5      (       a  U R
                  R                  U5      nO[        U R
                  US 5      nU H  nU[        U R                   5      S-
  :X  aN  U[        U5      -   U R                   S   :  d   S5       eU R                   R                  U[        U5      -   5        O)U R                   US-      U[        U5      -   :X  d   S5       eU[        SX-
  5      S   S h  vN   U[        U5      -  nUS-  nM     g  N7f)Nr   ry   z!offsets not monotonic increasing!z"inconsistent list value (num elts)r   )r   bisectbisect_rightrD   rB   r   r]   rh   r   r2   r   )r   start_indexsublist_indexr   sublist_itersublists         r   rh   LazyConcatenation.iterate_from2  sc    r**"//{KaOM.2Mm, djj"677::22=AL!$**mTBL#GT]]!3a!78CL(DMM",==767=$$US\%9:}}]Q%6753D <  878  s1k&9:<===S\!EQM $ >s   EE>E< E>r   N)	rW   rX   rY   rZ   r   r   rc   rh   r[   r'   r   r   r   r     s    !r   r   c                   0    \ rS rSrSrS rS rS rS rSr	g)	LazyMapiQ  a2  
A lazy sequence whose elements are formed by applying a given
function to each element in one or more underlying lists.  The
function is applied lazily -- i.e., when you read a value from the
list, ``LazyMap`` will calculate that value by applying its
function to the underlying lists' value(s).  ``LazyMap`` is
essentially a lazy version of the Python primitive function
``map``.  In particular, the following two expressions are
equivalent:

    >>> from nltk.collections import LazyMap
    >>> function = str
    >>> sequence = [1,2,3]
    >>> map(function, sequence) # doctest: +SKIP
    ['1', '2', '3']
    >>> list(LazyMap(function, sequence))
    ['1', '2', '3']

Like the Python ``map`` primitive, if the source lists do not have
equal size, then the value None will be supplied for the
'missing' elements.

Lazy maps can be useful for conserving memory, in cases where
individual values take up a lot of space.  This is especially true
if the underlying list's values are constructed lazily, as is the
case with many corpus readers.

A typical example of a use case for this class is performing
feature detection on the tokens in a corpus.  Since featuresets
are encoded as dictionaries, which can take up a lot of memory,
using a ``LazyMap`` can significantly reduce memory usage when
training and running classifiers.
c                     U(       d  [        S5      eX l        Xl        UR                  SS5      U l        U R                  S:  a  0 OSU l        [        S U 5       5      [        U5      :H  U l        g)a  
:param function: The function that should be applied to
    elements of ``lists``.  It should take as many arguments
    as there are ``lists``.
:param lists: The underlying lists.
:param cache_size: Determines the size of the cache used
    by this lazy map.  (default=5)
z"LazyMap requires at least two args
cache_sizer   r   Nc              3   B   #    U  H  n[        U[        5      v   M     g 7fr   )rB   r]   r(   lsts     r   r)   #LazyMap.__init__.<locals>.<genexpr>  s      
=BcJs011Us   )		TypeError_lists_funcr   _cache_size_cacher|   rD   	_all_lazy)r   functionlistsconfigs       r   r   LazyMap.__init__t  sm     @AA
!::lA6 ,,q0bd
  
=B
 
Zr   c              #   \  #    [        U R                  5      S:X  aJ  U R                  (       a9  U R                  S   R                  U5       H  nU R	                  U5      v   M     g [        U R                  5      S:X  a,    U R	                  U R                  S   U   5      v   US-  nM+  U R                  (       a  U R                   Vs/ s H  o3R                  U5      PM     nn / nU H  n UR                  [        U5      5        M      US /[        U R                  5      -  :X  a  g U R                  " U6 v   US-  nM\    U R                   Vs/ s H  o3U   PM	     nnU R                  " U6 v   US-  nM7  ! [
         a     g f = fs  snf !   UR                  S 5         M  = fs  snf ! [
         aq    S /[        U R                  5      -  n[        U R                  5       H  u  ps X1   XW'   M  ! [
         a     M  f = f   US /[        U R                  5      -  :X  a   g  Nf = f7f)Nry   r   )	rD   r   r   rh   r   rn   r2   ro   r   )r   r   rF   r   	iteratorselementsiteratorrq   s           r   rh   LazyMap.iterate_from  s    t{{q T^^Q44U;jj'' < "**T[[^E%:;; 
  ^^<@KKHKS))%0KIH )H. X7 !*
 vDKK(888jj(++
  
6:kkBksE
kHB jj(++
 + "  I. -  C!  $vDKK(88H"+DKK"8!*-*HK) ! ! #9
  D6C,<#<< =s   A>H,#E; $&H,
F$
H,/F	;H,F. F)!F. #H,;
FH,FH,F&#H,)F. .=H),G42H)4
H>H)H"H)$H,(H))H,c                 d   [        U[        5      (       a4  U R                   Vs/ s H  o"U   PM	     nn[        U R                  /UQ76 $ US:  a  U[        U 5      -  nUS:  a  [        S5      eU R                  b  XR                  ;   a  U R                  U   $  [        U R                  U5      5      nU R                  bK  [        U R                  5      U R                  :  a  U R                  R                  5         X@R                  U'   U$ s  snf ! [         a  n[        S5      UeS nAff = f)Nr   rk   )rB   rl   r   r   r   rD   rn   r   ro   rh   rp   r   rJ   )r   r   r   sliced_listsvalrs   s         r   r!   LazyMap.__getitem__  s   eU##26++>+3J+L>4::555 qyT"qy !566{{&5KK+?{{5))>4,,U34 {{&t{{#d&6&66KK'')%(E"J- ? ! > !56A=>s   DD 
D/D**D/c                 :    [        S U R                   5       5      $ )Nc              3   8   #    U  H  n[        U5      v   M     g 7fr   rD   r   s     r   r)   "LazyMap.__len__.<locals>.<genexpr>       3{3s88{   )r   r   r+   s    r   rc   LazyMap.__len__      3t{{333r   )r   r   r   r   r   N)
rW   rX   rY   rZ   r   r   rh   r!   rc   r[   r'   r   r   r   r   Q  s     D0.`44r   r   c                   *    \ rS rSrSrS rS rS rSrg)LazyZipi  aN  
A lazy sequence whose elements are tuples, each containing the i-th
element from each of the argument sequences.  The returned list is
truncated in length to the length of the shortest argument sequence. The
tuples are constructed lazily -- i.e., when you read a value from the
list, ``LazyZip`` will calculate that value by forming a tuple from
the i-th element of each of the argument sequences.

``LazyZip`` is essentially a lazy version of the Python primitive function
``zip``.  In particular, an evaluated LazyZip is equivalent to a zip:

    >>> from nltk.collections import LazyZip
    >>> sequence1, sequence2 = [1, 2, 3], ['a', 'b', 'c']
    >>> zip(sequence1, sequence2) # doctest: +SKIP
    [(1, 'a'), (2, 'b'), (3, 'c')]
    >>> list(LazyZip(sequence1, sequence2))
    [(1, 'a'), (2, 'b'), (3, 'c')]
    >>> sequences = [sequence1, sequence2, [6,7,8,9]]
    >>> list(zip(*sequences)) == list(LazyZip(*sequences))
    True

Lazy zips can be useful for conserving memory in cases where the argument
sequences are particularly long.

A typical example of a use case for this class is combining long sequences
of gold standard and predicted values in a classification or tagging task
in order to calculate accuracy.  By constructing tuples lazily and
avoiding the creation of an additional long sequence, memory usage can be
significantly reduced.
c                 6    [         R                  " U S /UQ76   g)z<
:param lists: the underlying lists
:type lists: list(list)
c                      U $ r   r'   )eltss    r   <lambda>"LazyZip.__init__.<locals>.<lambda>  s    Tr   N)r   r   )r   r   s     r   r   LazyZip.__init__  s    
 	1:E:r   c              #      #    [         R                  X5      nU[        U 5      :  a#  [        U5      v   US-  nU[        U 5      :  a  M#  g 7f)Nry   )r   rh   rD   ro   )r   r   r   s      r   rh   LazyZip.iterate_from  sG     ''4c$ix. QJE c$i 	s   AA
Ac                 :    [        S U R                   5       5      $ )Nc              3   8   #    U  H  n[        U5      v   M     g 7fr   r   r   s     r   r)   "LazyZip.__len__.<locals>.<genexpr>	  r  r  )minr   r+   s    r   rc   LazyZip.__len__  r  r   r'   N)	rW   rX   rY   rZ   r   r   rh   rc   r[   r'   r   r   r  r    s    >;4r   r  c                       \ rS rSrSrS rSrg)LazyEnumeratei  a  
A lazy sequence whose elements are tuples, each containing a count (from
zero) and a value yielded by underlying sequence.  ``LazyEnumerate`` is
useful for obtaining an indexed list. The tuples are constructed lazily
-- i.e., when you read a value from the list, ``LazyEnumerate`` will
calculate that value by forming a tuple from the count of the i-th
element and the i-th element of the underlying sequence.

``LazyEnumerate`` is essentially a lazy version of the Python primitive
function ``enumerate``.  In particular, the following two expressions are
equivalent:

    >>> from nltk.collections import LazyEnumerate
    >>> sequence = ['first', 'second', 'third']
    >>> list(enumerate(sequence))
    [(0, 'first'), (1, 'second'), (2, 'third')]
    >>> list(LazyEnumerate(sequence))
    [(0, 'first'), (1, 'second'), (2, 'third')]

Lazy enumerations can be useful for conserving memory in cases where the
argument sequences are particularly long.

A typical example of a use case for this class is obtaining an indexed
list for a long sequence of values.  By constructing tuples lazily and
avoiding the creation of an additional long sequence, memory usage can be
significantly reduced.
c                 V    [         R                  U [        [        U5      5      U5        g)z1
:param lst: the underlying list
:type lst: list
N)r  r   rangerD   )r   r   s     r   r   LazyEnumerate.__init__)  s    
 	uSX4r   r'   N)rW   rX   rY   rZ   r   r   r[   r'   r   r   r  r    s    85r   r  c                   :    \ rS rSrSrS
S jrS rS rS rS r	S	r
g)LazyIteratorListi1  z
Wraps an iterator, loading its elements on demand
and making them subscriptable.
__repr__ displays only the first few elements.
Nc                 *    Xl         X l        / U l        g r   )_it_lenr   )r   it	known_lens      r   r   LazyIteratorList.__init__8  s    	r   c                     U R                   (       a  U R                   $ U R                  [        U R                  5      5       H  nM     [        U R                  5      U l         U R                   $ r   )r  rh   rD   r   r   s     r   rc   LazyIteratorList.__len__=  sN    9999""3t{{#34A 5$	yyr   c              #     #    [        U R                  5      U:  aK  [        U R                  5      nU R                  R	                  U5        [        U R                  5      U:  a  MK  UnU[        U R                  5      :  a1  U R                  U   v   US-  nU[        U R                  5      :  a  M1    [        U R                  5      nU R                  R	                  U5        Uv   M6  ! [
         a     gf = f7f)zBCreate a new iterator over this list starting at the given offset.ry   N)rD   r   ro   r  r2   rp   )r   rg   vrq   s       r   rh   LazyIteratorList.iterate_fromE  s     $++&TXXAKKq! $++& #dkk""++a. FA #dkk""	N""1%   		s+   A#C;'A
C;47C+ +
C85C;7C88C;c                 6    [        U 5      " [        X5      5      $ r   r   r   r   s     r   r   LazyIteratorList.__add__V  s    Dz%,--r   c                 6    [        U 5      " [        X5      5      $ r   r(  r   s     r   r   LazyIteratorList.__radd__Z  s    Dz%,--r   )r   r  r  r   )rW   rX   rY   rZ   r   r   rc   rh   r   r   r[   r'   r   r   r  r  1  s     
"..r   r  c                   @   ^  \ rS rSrSrSrSU 4S jjrS rS rSr	U =r
$ )	Trieib  z!A Trie implementation for stringsTc                 f   > [         TU ]  5         U(       a  U H  nU R                  U5        M     gg)aA  Builds a Trie object, which is built around a ``dict``

If ``strings`` is provided, it will add the ``strings``, which
consist of a ``list`` of ``strings``, to the Trie.
Otherwise, it'll construct an empty Trie.

:param strings: List of strings to insert into the trie
    (Default is ``None``)
:type strings: list(str)

N)superr   insert)r   stringsstringr   s      r   r   Trie.__init__g  s.     	!F# " r   c                 ~    [        U5      (       a  XS      R                  USS 5        gSU [        R                  '   g)a9  Inserts ``string`` into the Trie

:param string: String to insert into the trie
:type string: str

:Example:

>>> from nltk.collections import Trie
>>> trie = Trie(["abc", "def"])
>>> expected = {'a': {'b': {'c': {True: None}}},                         'd': {'e': {'f': {True: None}}}}
>>> trie == expected
True

r   ry   N)rD   r0  r-  LEAF)r   r2  s     r   r0  Trie.insertx  s6      v;;O""6!":. #DOr   c                 "    [        5       X'   X   $ r   )r-  r   s     r   r#   Trie.__missing__  s    F	yr   r'   r   )rW   rX   rY   rZ   r   r5  r   r0  r#   r[   __classcell__)r   s   @r   r-  r-  b  s    +D$"#, r   r-  )r   	functoolsr   	itertoolsr   r   nltk.internalsr   r   r   r	   r]   rm   r   r   r  r  r  r-  r'   r   r   <module>r=     s     $ # @V)$ V)| AP AP APH&
* &
R/, /dF4" F4R/4g /4d"5G "5J+.+ +.b.4 .r   