a
    Kb
                     @   sJ   d dl Z d dlmZ d dlmZmZmZ d dlmZ	 dZ
G dd dZdS )    N)config_megam)RTEFeatureExtractorrte_classifierrte_features)rtea  
alwayson        => True
ne_hyp_extra    => 0
ne_overlap      => 1
neg_hyp         => 0
neg_txt         => 0
word_hyp_extra  => 3
word_overlap    => 3

alwayson        => True
ne_hyp_extra    => 0
ne_overlap      => 1
neg_hyp         => 0
neg_txt         => 0
word_hyp_extra  => 2
word_overlap    => 1

alwayson        => True
ne_hyp_extra    => 1
ne_overlap      => 1
neg_hyp         => 0
neg_txt         => 0
word_hyp_extra  => 1
word_overlap    => 2

alwayson        => True
ne_hyp_extra    => 1
ne_overlap      => 0
neg_hyp         => 0
neg_txt         => 0
word_hyp_extra  => 6
word_overlap    => 2

alwayson        => True
ne_hyp_extra    => 1
ne_overlap      => 0
neg_hyp         => 0
neg_txt         => 0
word_hyp_extra  => 4
word_overlap    => 0

alwayson        => True
ne_hyp_extra    => 1
ne_overlap      => 0
neg_hyp         => 0
neg_txt         => 0
word_hyp_extra  => 3
word_overlap    => 1
c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TestRTEClassifierc                 C   sN   t dgd d }dd |D }t d}ttd |}||ksJJ d S )Nzrte1_dev.xml   c                 S   s6   g | ].}t t|D ]}|d dt||  qqS )z<15z => )sortedr   ).0Zpairkey r   ?lib/python3.9/site-packages/nltk/test/unit/test_rte_classify.py
<listcomp>>   s   zATestRTEClassifier.test_rte_feature_extraction.<locals>.<listcomp>
)
rte_corpuspairs#expected_from_rte_feature_extrationstripsplitlistfilter)selfr   Ztest_outputZexpected_outputr   r   r   test_rte_feature_extraction<   s    z-TestRTEClassifier.test_rte_feature_extractionc                 C   sj   t dgd }t|}|jh dks*J |dt ks>J |ddhksRJ |ddhksfJ d S )Nzrte3_dev.xml!   >   zSCO.ChinamemberZwordner   r   )r   r   r   Z	hyp_wordsZoverlapsetZ	hyp_extra)r   ZrtepairZ	extractorr   r   r   test_feature_extractor_objectI   s    z/TestRTEClassifier.test_feature_extractor_objectc                 C   s   t ddd}t ddd}d S )NZIISd   Zsample_NZGIS)r   )r   clfr   r   r   %test_rte_classification_without_megamS   s    z7TestRTEClassifier.test_rte_classification_without_megamc              
   C   sN   z
t   W n2 ttfy< } ztd W Y d }~n
d }~0 0 tddd}d S )Nz)Skipping tests with dependencies on MEGAMZmegamr   r    )r   LookupErrorAttributeErrorpytestskipr   )r   er!   r   r   r   "test_rte_classification_with_megamY   s
    
 z4TestRTEClassifier.test_rte_classification_with_megamN)__name__
__module____qualname__r   r   r"   r(   r   r   r   r   r   :   s   
r   )r%   Znltkr   Znltk.classify.rte_classifyr   r   r   Znltk.corpusr   r   r   r   r   r   r   r   <module>   s
   3