mirror of
https://github.com/explosion/spaCy.git
synced 2025-03-03 10:55:52 +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 ...matcher import Matcher
|
||||||
from ...attrs import ORTH
|
from ...attrs import ORTH
|
||||||
from ..util import get_doc
|
|
||||||
|
|
||||||
|
|
||||||
def test_issue615(en_tokenizer):
|
def test_issue615(en_tokenizer):
|
||||||
|
@ -23,9 +22,7 @@ def test_issue615(en_tokenizer):
|
||||||
pattern = [{ ORTH: "golf"}, { ORTH: "club"}]
|
pattern = [{ ORTH: "golf"}, { ORTH: "club"}]
|
||||||
label = "Sport_Equipment"
|
label = "Sport_Equipment"
|
||||||
|
|
||||||
tokens = en_tokenizer(text)
|
doc = en_tokenizer(text)
|
||||||
doc = get_doc(tokens.vocab, [t.text for t in tokens])
|
|
||||||
|
|
||||||
matcher = Matcher(doc.vocab)
|
matcher = Matcher(doc.vocab)
|
||||||
matcher.add_entity(label, on_match=merge_phrases)
|
matcher.add_entity(label, on_match=merge_phrases)
|
||||||
matcher.add_pattern(label, pattern, label=label)
|
matcher.add_pattern(label, pattern, label=label)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user