Add basic test for PhraseMatcher

#613
This commit is contained in:
Dmitry Sadovnychyi 2016-11-09 00:10:32 +08:00
parent 660c3268c1
commit 86c056ba64

View File

@ -87,6 +87,13 @@ def test_match_zero_plus(matcher):
assert len(matcher(doc)) == 1
def test_phrase_matcher():
vocab = Vocab(lex_attr_getters=English.Defaults.lex_attr_getters)
matcher = PhraseMatcher(vocab, [Doc(vocab, words='Google Now'.split())])
doc = Doc(vocab, words=['I', 'like', 'Google', 'Now', 'best'])
assert len(matcher(doc)) == 1
#@pytest.mark.models
#def test_match_preserved(EN):
# patterns = {