2018-02-07 01:06:11 +00:00
|
|
|
'''Test regression in Matcher introduced in v2.0.6.'''
|
2018-02-07 00:29:23 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
import pytest
|
|
|
|
|
2018-02-07 01:06:11 +00:00
|
|
|
from ...vocab import Vocab
|
|
|
|
from ...tokens import Doc
|
2018-02-13 15:35:20 +00:00
|
|
|
from ...matcher2 import Matcher
|
2018-02-07 00:29:23 +00:00
|
|
|
|
2018-02-13 15:35:20 +00:00
|
|
|
#@pytest.mark.xfail
|
2018-02-07 00:29:23 +00:00
|
|
|
def test_issue1945():
|
2018-02-07 01:06:11 +00:00
|
|
|
text = "a a a"
|
|
|
|
matcher = Matcher(Vocab())
|
|
|
|
matcher.add('MWE', None, [{'orth': 'a'}, {'orth': 'a'}])
|
|
|
|
doc = Doc(matcher.vocab, words=['a', 'a', 'a'])
|
|
|
|
matches = matcher(doc)
|
|
|
|
# We should see two overlapping matches here
|
|
|
|
assert len(matches) == 2
|
|
|
|
assert matches[0][1:] == (0, 2)
|
|
|
|
assert matches[1][1:] == (1, 3)
|