ó
k4Vdc           @` sF   d  d l  m Z m Z m Z d  d l m Z d e f d „  ƒ  YZ d S(   i    (   t   absolute_importt   divisiont   unicode_literals(   t   Mappingt   Triec           B` s5   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z RS(   u   Abstract base class for triesc         C` sQ   t  ƒ  j ƒ  } | d  k r% t | ƒ St g  | D] } | j | ƒ r/ | ^ q/ ƒ S(   N(   t   supert   keyst   Nonet   sett
   startswith(   t   selft   prefixR   t   x(    (    sa   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/html5lib/trie/_base.pyR   	   s    
c         C` s.   x' |  j  ƒ  D] } | j | ƒ r t Sq Wt S(   N(   R   R	   t   Truet   False(   R
   R   t   key(    (    sa   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/html5lib/trie/_base.pyt   has_keys_with_prefix   s    c         C` s^   | |  k r | Sx; t  d t | ƒ d ƒ D]  } | |  |  k r* | |  Sq* Wt | ƒ ‚ d  S(   Ni   (   t   ranget   lent   KeyError(   R
   R   t   i(    (    sa   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/html5lib/trie/_base.pyt   longest_prefix   s     c         C` s   |  j  | ƒ } | |  | f S(   N(   R   (   R
   R   t   lprefix(    (    sa   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/html5lib/trie/_base.pyt   longest_prefix_item#   s    N(   t   __name__t
   __module__t   __doc__R   R   R   R   R   (    (    (    sa   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/html5lib/trie/_base.pyR      s
   			
N(   t
   __future__R    R   R   t   collectionsR   R   (    (    (    sa   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/html5lib/trie/_base.pyt   <module>   s   