mirror of https://github.com/explosion/spaCy.git
Update docs [ci skip]
This commit is contained in:
parent
a8b5f78fc3
commit
b3e338d65e
|
@ -209,11 +209,18 @@ aren't set.
|
|||
> #### Example
|
||||
>
|
||||
> ```python
|
||||
> # TODO: example
|
||||
> from spacy.matcher import DependencyMatcher
|
||||
>
|
||||
> matcher = DependencyMatcher(nlp.vocab)
|
||||
> pattern = [
|
||||
> {"RIGHT_ID": "anchor_founded", "RIGHT_ATTRS": {"ORTH": "founded"}},
|
||||
> {"LEFT_ID": "anchor_founded", "REL_OP": ">", "RIGHT_ID": "subject", "RIGHT_ATTRS": {"DEP": "nsubj"}}
|
||||
> ]
|
||||
> matcher.add("FOUNDED", [pattern])
|
||||
> ```
|
||||
|
||||
The [`DependencyMatcher`](/api/dependencymatcher) lets you match patterns within
|
||||
the dependency parse using
|
||||
The new [`DependencyMatcher`](/api/dependencymatcher) lets you match patterns
|
||||
within the dependency parse using
|
||||
[Semgrex](https://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/semgraph/semgrex/SemgrexPattern.html)
|
||||
operators. It follows the same API as the token-based [`Matcher`](/api/matcher).
|
||||
A pattern added to the dependency matcher consists of a **list of
|
||||
|
|
Loading…
Reference in New Issue