2017-01-10 18:24:10 +00:00
|
|
|
# coding: utf-8
|
2016-11-06 10:21:36 +00:00
|
|
|
from __future__ import unicode_literals
|
2017-01-10 18:24:10 +00:00
|
|
|
|
2016-11-06 10:21:36 +00:00
|
|
|
from ...matcher import Matcher
|
2017-01-12 21:00:37 +00:00
|
|
|
from ..util import get_doc
|
2016-11-06 10:21:36 +00:00
|
|
|
|
2017-01-10 18:24:10 +00:00
|
|
|
|
2017-01-12 21:00:37 +00:00
|
|
|
def test_issue590(en_vocab):
|
|
|
|
"""Test overlapping matches"""
|
|
|
|
doc = get_doc(en_vocab, ['n', '=', '1', ';', 'a', ':', '5', '%'])
|
|
|
|
matcher = Matcher(en_vocab)
|
2017-05-22 11:54:20 +00:00
|
|
|
matcher.add('ab', None, [{'IS_ALPHA': True}, {'ORTH': ':'}, {'LIKE_NUM': True}, {'ORTH': '%'}])
|
|
|
|
matcher.add('ab', None, [{'IS_ALPHA': True}, {'ORTH': '='}, {'LIKE_NUM': True}])
|
2016-11-06 10:21:36 +00:00
|
|
|
matches = matcher(doc)
|
|
|
|
assert len(matches) == 2
|