o
    Mf
                     @   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s%J d S )Nzrte1_dev.xml   c                 S   s6   g | ]}t t|D ]}|d dt||  q
qS )z<15z => )sortedr   ).0pairkey r   b/var/www/html/analyze/labelStudio/lib/python3.10/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   test_output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s)J |ddhks3J d S )Nzrte3_dev.xml!   >   SCO.Chinamemberwordner   r   )r   r   r   	hyp_wordsoverlapset	hyp_extra)r   rtepair	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 )NIISd   sample_NGIS)r   )r   clfr   r   r   %test_rte_classification_without_megamS   s   z7TestRTEClassifier.test_rte_classification_without_megamc              
   C   sN   zt   W n ttfy } ztd W Y d }~nd }~ww tddd}d S )Nz)Skipping tests with dependencies on MEGAM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/   r6   r   r   r   r   r   :   s
    
r   )r3   nltkr   nltk.classify.rte_classifyr   r   r   nltk.corpusr   r   r   r   r   r   r   r   <module>   s    3