ķ
ų`]c           @   s:   d  d l  m Z d  d l m Z d e f d     YZ d S(   i˙˙˙˙(   t   ParserI(   t
   ChunkScoret   ChunkParserIc           B   s    e  Z d  Z d   Z d   Z RS(   s;  
    A processing interface for identifying non-overlapping groups in
    unrestricted text.  Typically, chunk parsers are used to find base
    syntactic constituents, such as base noun phrases.  Unlike
    ``ParserI``, ``ChunkParserI`` guarantees that the ``parse()`` method
    will always generate a parse.
    c         C   s   t     d S(   sŪ   
        Return the best chunk structure for the given tokens
        and return a tree.

        :param tokens: The list of (word, tag) tokens to be chunked.
        :type tokens: list(tuple)
        :rtype: Tree
        N(   t   NotImplementedError(   t   selft   tokens(    (    s-   lib/python2.7/site-packages/nltk/chunk/api.pyt   parse   s    	c         C   s=   t    } x- | D]% } | j | |  j | j     q W| S(   s  
        Score the accuracy of the chunker against the gold standard.
        Remove the chunking the gold standard text, rechunk it using
        the chunker, and return a ``ChunkScore`` object
        reflecting the performance of this chunk peraser.

        :type gold: list(Tree)
        :param gold: The list of chunked sentences to score the chunker on.
        :rtype: ChunkScore
        (   R   t   scoreR   t   leaves(   R   t   goldt
   chunkscoret   correct(    (    s-   lib/python2.7/site-packages/nltk/chunk/api.pyt   evaluate&   s    	#(   t   __name__t
   __module__t   __doc__R   R   (    (    (    s-   lib/python2.7/site-packages/nltk/chunk/api.pyR      s   	N(   t
   nltk.parseR    t   nltk.chunk.utilR   R   (    (    (    s-   lib/python2.7/site-packages/nltk/chunk/api.pyt   <module>   s   