mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
Missing import statement
It is useful to know where the Matcher class is if you haven't used it before. Or you are simply too lazy to remember, like me :) FYI: some packages don't appear in the PyCharm autocompletion lists. `spacy.matcher` is one of them.
This commit is contained in:
parent
f123f92e0c
commit
250879bb96
|
@ -21,6 +21,7 @@ p
|
||||||
| callable, to receive a list of #[code (ent_id, start, end)] tuples:
|
| callable, to receive a list of #[code (ent_id, start, end)] tuples:
|
||||||
|
|
||||||
+code.
|
+code.
|
||||||
|
from spacy.matcher import Matcher
|
||||||
matcher = Matcher(nlp.vocab)
|
matcher = Matcher(nlp.vocab)
|
||||||
matcher.add_pattern("HelloWorld", [{LOWER: "hello"}, {IS_PUNCT: True}, {LOWER: "world"}])
|
matcher.add_pattern("HelloWorld", [{LOWER: "hello"}, {IS_PUNCT: True}, {LOWER: "world"}])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user