
    g1                     |    d dl Z d dlmZ d dlmZ d dlmZ  e j                  d      d        Zd Z	 G d	 d
      Z
y)    N)find)BllipParser)Treemodule)scopec                  V    t        d      j                  } t        j                  |       S )Nzmodels/bllip_wsj_no_aux)r   pathr   from_unified_model_dir)	model_dirs    N/var/www/openai/venv/lib/python3.12/site-packages/nltk/test/unit/test_bllip.pyparserr      s$    ./44I--i88    c                  .    t        j                  d       y )Nbllipparser)pytestimportorskip r   r   setup_moduler      s    
&r   c                       e Zd Zd Zd Zy)TestBllipParserc                     |j                  d      }t        |      }t        |t              sJ |j	                         dj                         k(  sJ y )N I saw the man with the telescopez
(S1
  (S
    (NP (PRP I))
    (VP
      (VBD saw)
      (NP (DT the) (NN man))
      (PP (IN with) (NP (DT the) (NN telescope))))))
)parsenext
isinstancer   pformatstrip)selfr   parsedtrees       r   test_parser_loads_a_valid_treez.TestBllipParser.test_parser_loads_a_valid_tree   sP    @AF|$%%%LLN 
EG		
	r   c                     |j                  d      }t        |j                  dg            }t        |t              sJ |j                         dk(  sJ y )Nr   )	telescopeNNz(S1 (NP (NN telescope))))r   r   tagged_parser   r   r   )r   r   r   tagged_trees       r   (test_tagged_parse_finds_matching_elementz8TestBllipParser.test_tagged_parse_finds_matching_element%   sR    @A6..0C/DEF+t,,,""$(BBBBr   N)__name__
__module____qualname__r!   r'   r   r   r   r   r      s    
$Cr   r   )r   	nltk.datar   nltk.parse.bllipr   	nltk.treer   fixturer   r   r   r   r   r   <module>r/      sA      (  h9  9
'C Cr   