B
    .(b!                 @   s0   d dl mZ d dlmZ d dlmZ dd ZdS )    )unicode_literals)English)EntityRulerc              C   s   t  } t| ddddddddgdd}| | d	}d
}x0| j|gddD ]}|tdd |jD 7 }qLW |dksxtd
}x0| j|gddD ]}|tdd |jD 7 }qW |dkstd S )NZPERSONz	joe bidenz	joe-biden)labelpatternidzbernie sanderszbernie-sandersZLOWER)patternsZphrase_matcher_attrz
    The left is starting to take aim at Democratic front-runner Joe Biden.
    Sen. Bernie Sanders joined in her criticism: "There is no 'middle ground' when it comes to climate policy."
    r      )Z	n_processc             S   s   g | ]}|j d kr|qS )r   )ent_id).0ent r   T/home/dcms/DCMS/lib/python3.7/site-packages/spacy/tests/regression/test_issue4849.py
<listcomp>   s    z"test_issue4849.<locals>.<listcomp>   c             S   s   g | ]}|j d kr|qS )r   )r
   )r   r   r   r   r   r   $   s    )r   r   Zadd_pipepipelenZentsAssertionError)ZnlpZrulertextZ
count_entsdocr   r   r   test_issue4849   s     

r   N)
__future__r   Zspacy.lang.enr   Zspacy.pipeliner   r   r   r   r   r   <module>   s   