ณ๒
4าวIc           @   s   d  e  f d     YZ d S(   t   ModelIc           B   sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   sN   
    A processing interface for assigning a probability to the next word.
    c         C   s   t     d S(   s   Create a new language model.N(   t   NotImplementedError(   t   self(    (    s$   /p/zhu/06/nlp/nltk/nltk/model/api.pyt   __init__	   s    c         C   s   t     d S(   s6   Evaluate the probability of this word in this context.N(   R   (   R   t   wordt   context(    (    s$   /p/zhu/06/nlp/nltk/nltk/model/api.pyt   prob   s    c         C   s   t     d S(   sE   Evaluate the (negative) log probability of this word in this context.N(   R   (   R   R   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/model/api.pyt   logprob   s    c         C   s   t     d S(   s@   Randomly select a word that is likely to appear in this context.N(   R   (   R   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/model/api.pyt   choose_random_word   s    c         C   s   t     d S(   s1   Generate n words of text from the language model.N(   R   (   R   t   n(    (    s$   /p/zhu/06/nlp/nltk/nltk/model/api.pyt   generate   s    c         C   s   t     d S(   s   Evaluate the total entropy of a message with respect to the model.
        This is the sum of the log probability of each word in the message.N(   R   (   R   t   text(    (    s$   /p/zhu/06/nlp/nltk/nltk/model/api.pyt   entropy   s    (	   t   __name__t
   __module__t   __doc__R   R   R   R   R
   R   (    (    (    s$   /p/zhu/06/nlp/nltk/nltk/model/api.pyR       s   					N(   t   objectR    (    (    (    s$   /p/zhu/06/nlp/nltk/nltk/model/api.pys   <module>   s    