B
    .(b                 @   sD   d dl mZ ddlmZ dd Zdd Zdd	 Zd
d Zdd ZdS )    )unicode_literals   )get_docc             C   s   d}dddddddg}ddd	d
dddg}dddddddg}| |}t |jdd |D |||d}t|j}t|dkszt|d jdkstd S )Nz#A base phrase should be recognized.      r   r   DTJJNNZMDZVBZVBN.detamodZ	nsubjpassZauxZauxpassROOTpunctc             S   s   g | ]
}|j qS  )text).0tr   r   N/home/dcms/DCMS/lib/python3.7/site-packages/spacy/tests/lang/en/test_parser.py
<listcomp>   s    z7test_en_parser_noun_chunks_standard.<locals>.<listcomp>)wordstagsdepsheadszA base phrase )r   vocablistnoun_chunkslenAssertionErrortext_with_ws)en_tokenizerr   r   r   r   tokensdocchunksr   r   r   #test_en_parser_noun_chunks_standard   s    
r$   c             C   s   d}ddddddddddddg}d	d
d
dd	dd
ddd	ddg}ddddddddddddg}| |}t |jdd |D |||d}t|j}t|dkst|d jdkst|d jdkstd S )Nz3A base phrase and a good phrase are often the same.r   r      r   r   r   r
   CCr	   ZVBPZRBr   r   Zcompoundnsubjccr   Zconjr   Zadvmodattrr   c             S   s   g | ]
}|j qS r   )r   )r   r   r   r   r   r      s    z:test_en_parser_noun_chunks_coordinated.<locals>.<listcomp>)r   r   r   r   zA base phrase za good phrase )r   r   r   r   r   r   r   )r    r   r   r   r   r!   r"   r#   r   r   r   &test_en_parser_noun_chunks_coordinated   s    
r,   c             C   s   d}dddddddg}ddd	ddd
dg}dddddddg}| |}t |jdd |D |||d}t|j}t|dkszt|d jdkst|d jdkstd S )Nz$A phrase with another phrase occurs.r      r   r   r   r
   INZVBZr   r   r)   preppobjr   r   c             S   s   g | ]
}|j qS r   )r   )r   r   r   r   r   r   -   s    z8test_en_parser_noun_chunks_pp_chunks.<locals>.<listcomp>)r   r   r   r   r   z	A phrase zanother phrase )r   r   r   r   r   r   r   )r    r   r   r   r   r!   r"   r#   r   r   r   $test_en_parser_noun_chunks_pp_chunks&   s    
r2   c          
   C   s   d}ddddddddddg
}d	d
ddd
dddddg
}ddddddddddg
}| |}t |jdd |D |||d}t|j}t|dkst|d jdkst|d jdkst|d jd kstd S )!Nz&Sam, my brother, arrived to the house.r%   r   r   r'   r&   r   r.   NNP,zPRP$r
   VBDr/   r   r   r)   r   ZpossZapposr   r0   r   r1   c             S   s   g | ]
}|j qS r   )r   )r   r   r   r   r   r   >   s    zEtest_en_parser_noun_chunks_appositional_modifiers.<locals>.<listcomp>)r   r   r   r   r   zSam zmy brother r   z
the house )r   r   r   r   r   r   r   )r    r   r   r   r   r!   r"   r#   r   r   r   1test_en_parser_noun_chunks_appositional_modifiers5   s    
r6   c             C   s   d}ddddddg}ddd	d
ddg}ddddddg}| |}t |jdd |D |||d}t|j}t|dkstt|d jdkst|d jdkst|d jdkstd S )NzShe gave Bob a raise.r   r   r   r'   r&   ZPRPr5   r3   r   r
   r   r)   r   Zdativer   Zdobjr   c             S   s   g | ]
}|j qS r   )r   )r   r   r   r   r   r   N   s    z5test_en_parser_noun_chunks_dative.<locals>.<listcomp>)r   r   r   r   r   zShe zBob r   za raise )r   r   r   r   r   r   r   )r    r   r   r   r   r!   r"   r#   r   r   r   !test_en_parser_noun_chunks_dativeG   s    
r7   N)	
__future__r   utilr   r$   r,   r2   r6   r7   r   r   r   r   <module>   s   