mirror of https://github.com/explosion/spaCy.git
Add test for #1945: PhraseMatcher regression
This commit is contained in:
parent
ebe84e45e5
commit
76d89b2180
|
@ -0,0 +1,17 @@
|
||||||
|
'''Test regression in PhraseMatcher introduced in v2.0.6.'''
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from ...lang.en import English
|
||||||
|
from ...matcher import PhraseMatcher
|
||||||
|
|
||||||
|
@pytest.mark.xfail
|
||||||
|
def test_issue1945():
|
||||||
|
text = "deep machine learning"
|
||||||
|
mw_list = ["machine learning", "deep blue", "planing machine"]
|
||||||
|
|
||||||
|
nlp = English()
|
||||||
|
matcher = PhraseMatcher(nlp.vocab)
|
||||||
|
matcher.add("MWE", None, *[nlp.tokenizer(item) for item in mw_list])
|
||||||
|
|
||||||
|
assert len(matcher(nlp(text))) == 1
|
Loading…
Reference in New Issue