
    Ngb                     F    d dl mZ d dlmZ d dlmZ  G d de          ZdS )    )
ChunkScore)
deprecated)ParserIc                   F    e Zd ZdZd Z ed          d             Z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                     t                      )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
        )NotImplementedError)selftokenss     J/var/www/html/ai-engine/env/lib/python3.11/site-packages/nltk/chunk/api.pyparsezChunkParserI.parse   s     "###    zUse accuracy(gold) instead.c                 ,    |                      |          S )N)accuracy)r
   golds     r   evaluatezChunkParserI.evaluate&   s    }}T"""r   c                     t                      }|D ]=}|                    ||                     |                                                     >|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 parser.

        :type gold: list(Tree)
        :param gold: The list of chunked sentences to score the chunker on.
        :rtype: ChunkScore
        )r   scorer   leaves)r
   r   
chunkscorecorrects       r   r   zChunkParserI.accuracy*   sS      \\
 	D 	DGWdjj1A1A&B&BCCCCr   N)__name__
__module____qualname____doc__r   r   r   r    r   r   r   r      sc         	$ 	$ 	$ Z-..# # /.#    r   r   N)nltk.chunk.utilr   nltk.internalsr   
nltk.parser   r   r   r   r   <module>r       sq    ' & & & & & % % % % % %      & & & & &7 & & & & &r   