
    gb                     >    d dl mZ d dlmZ d dlmZ  G d de      Zy)    )
ChunkScore)
deprecated)ParserIc                   8    e Zd ZdZd Z ed      d        Zd Zy)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     C/var/www/openai/venv/lib/python3.12/site-packages/nltk/chunk/api.pyparsezChunkParserI.parse   s     "##    zUse accuracy(gold) instead.c                 $    | j                  |      S )N)accuracy)r
   golds     r   evaluatezChunkParserI.evaluate&   s    }}T""r   c                     t               }|D ]1  }|j                  || j                  |j                                      3 |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*   s;      \
GWdjj1A&BC r   N)__name__
__module____qualname____doc__r   r   r   r    r   r   r   r      s+    	$ -.# /#r   r   N)nltk.chunk.utilr   nltk.internalsr   
nltk.parser   r   r   r   r   <module>r       s    ' % &7 &r   