mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Update test to not create redundant Doc object
This commit is contained in:
parent
a2526e66d8
commit
0a4dc632bd
|
@ -3,7 +3,6 @@ from __future__ import unicode_literals
|
|||
|
||||
from ...matcher import Matcher
|
||||
from ...attrs import ORTH
|
||||
from ..util import get_doc
|
||||
|
||||
|
||||
def test_issue615(en_tokenizer):
|
||||
|
@ -23,9 +22,7 @@ def test_issue615(en_tokenizer):
|
|||
pattern = [{ ORTH: "golf"}, { ORTH: "club"}]
|
||||
label = "Sport_Equipment"
|
||||
|
||||
tokens = en_tokenizer(text)
|
||||
doc = get_doc(tokens.vocab, [t.text for t in tokens])
|
||||
|
||||
doc = en_tokenizer(text)
|
||||
matcher = Matcher(doc.vocab)
|
||||
matcher.add_entity(label, on_match=merge_phrases)
|
||||
matcher.add_pattern(label, pattern, label=label)
|
||||
|
|
Loading…
Reference in New Issue
Block a user