Update test for 850, making it work with matcher2

This commit is contained in:
Matthew Honnibal 2018-02-13 16:35:20 +01:00
parent 9bdfa5cd4f
commit dcd8d89aef
2 changed files with 5 additions and 6 deletions

View File

@ -4,9 +4,9 @@ import pytest
from ...vocab import Vocab
from ...tokens import Doc
from ...matcher import Matcher
from ...matcher2 import Matcher
@pytest.mark.xfail
#@pytest.mark.xfail
def test_issue1945():
text = "a a a"
matcher = Matcher(Vocab())

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals
import pytest
from ...matcher import Matcher
from ...matcher2 import Matcher
from ...vocab import Vocab
from ...attrs import LOWER
from ...tokens import Doc
@ -22,10 +22,9 @@ def test_basic_case():
assert end == 4
@pytest.mark.xfail
def test_issue850():
"""The problem here is that the variable-length pattern matches the
succeeding token. We then don't handle the ambiguity correctly."""
"""The variable-length pattern matches the
succeeding token. Check we handle the ambiguity correctly."""
matcher = Matcher(Vocab(
lex_attr_getters={LOWER: lambda string: string.lower()}))
IS_ANY_TOKEN = matcher.vocab.add_flag(lambda x: True)