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:
Sasho Savkov 2016-11-11 12:04:08 +00:00 committed by GitHub
parent f123f92e0c
commit 250879bb96

View File

@ -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"}])