forked from explosion/spaCy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ty.py
More file actions
18 lines (16 loc) · 748 Bytes
/
test_ty.py
File metadata and controls
18 lines (16 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import spacy
from spacy import ty
def test_component_types():
nlp = spacy.blank("en")
tok2vec = nlp.create_pipe("tok2vec")
tagger = nlp.create_pipe("tagger")
entity_ruler = nlp.create_pipe("entity_ruler")
assert isinstance(tok2vec, ty.TrainableComponent)
assert isinstance(tagger, ty.TrainableComponent)
assert not isinstance(entity_ruler, ty.TrainableComponent)
assert isinstance(tok2vec, ty.InitializableComponent)
assert isinstance(tagger, ty.InitializableComponent)
assert isinstance(entity_ruler, ty.InitializableComponent)
assert isinstance(tok2vec, ty.ListenedToComponent)
assert not isinstance(tagger, ty.ListenedToComponent)
assert not isinstance(entity_ruler, ty.ListenedToComponent)