o
    hw                     @   sX   d Z ddlZddlZddlZddlmZ ejjejjgZ	dZ
dd Zdd Zd	d
 ZdS )zY
Test a couple different classes of trees to check the output of the Starlang conversion
    N)convert_starlangu  ( (S (NP (NP {morphologicalAnalysis=bayan+NOUN+A3SG+PNON+NOM}{metaMorphemes=bayan}{turkish=Bayan}{english=Ms.}{semantics=TUR10-0396530}{namedEntity=PERSON}{propBank=ARG0$TUR10-0148580}{englishSemantics=ENG31-06352895-n}) (NP {morphologicalAnalysis=haag+NOUN+PROP+A3SG+PNON+NOM}{metaMorphemes=haag}{turkish=Haag}{english=Haag}{semantics=TUR10-0000000}{namedEntity=PERSON}{propBank=ARG0$TUR10-0148580}))  (VP (NP {morphologicalAnalysis=elianti+NOUN+PROP+A3SG+PNON+NOM}{metaMorphemes=elianti}{turkish=Elianti}{english=Elianti}{semantics=TUR10-0000000}{namedEntity=NONE}{propBank=ARG1$TUR10-0148580}) (VP {morphologicalAnalysis=çal+VERB+POS+AOR+A3SG}{metaMorphemes=çal+Ar}{turkish=çalar}{english=plays}{semantics=TUR10-0148580}{namedEntity=NONE}{propBank=PREDICATE$TUR10-0148580}{englishSemantics=ENG31-01730049-v}))  (. {morphologicalAnalysis=.+PUNC}{metaMorphemes=.}{metaMorphemesMoved=.}{turkish=.}{english=.}{semantics=TUR10-1081860}{namedEntity=NONE}{propBank=NONE}))  )c                  C   s   t t} dt| ksJ dS )z 
    Test a basic tree read
    uH   (ROOT (S (NP (NP Bayan) (NP Haag)) (VP (NP Elianti) (VP çalar)) (. .)))N)r   	read_treeTREEstr)tree r   j/var/www/html/env_mimamsha/lib/python3.10/site-packages/stanza/tests/constituency/test_convert_starlang.pytest_read_tree   s   
r	   c                  C   F   t dd} tt t| }W d   dS 1 sw   Y  dS )z=
    Test that an error is thrown if the word is missing
    zturkish=zfoo=Nr   replacepytestraises
ValueErrorr   r   	tree_textr   r   r   r   test_missing_word      "r   c                  C   r
   )z;
    Test that an unexpected label results in an error
    z(Sz(sNr   r   r   r   r   test_bad_label   r   r   )__doc__ostempfiler   "stanza.utils.datasets.constituencyr   markpipelinetravis
pytestmarkr   r	   r   r   r   r   r   r   <module>   s    