B
    >?ð[È  ã               @   s,   d dl mZ d dlmZ G dd„ deƒZdS )é    )ÚParserI)Ú
ChunkScorec               @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚChunkParserIa;  
    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 )zÞ
        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)ÚNotImplementedError)ÚselfÚtokens© r   ú-lib/python3.7/site-packages/nltk/chunk/api.pyÚparse   s    	zChunkParserI.parsec             C   s.   t ƒ }x"|D ]}| ||  | ¡ ¡¡ qW |S )aŒ  
        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   Zscorer
   Zleaves)r   ZgoldZ
chunkscoreZcorrectr   r   r	   Úevaluate&   s    
zChunkParserI.evaluateN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   r   r	   r      s   r   N)Z
nltk.parser   Znltk.chunk.utilr   r   r   r   r   r	   Ú<module>   s   