mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
1f7229f40f
This reverts commitc9ba3d3c2d
, reversing changes made to92c26a35d4
.
19 lines
557 B
Python
19 lines
557 B
Python
'''Test regression in Matcher introduced in v2.0.6.'''
|
|
from __future__ import unicode_literals
|
|
import pytest
|
|
|
|
from ...vocab import Vocab
|
|
from ...tokens import Doc
|
|
from ...matcher import Matcher
|
|
|
|
def test_issue1945():
|
|
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)
|