MCPcopy
hub / github.com/explosion/spaCy / test_matcher_from_api_docs

Function test_matcher_from_api_docs

spacy/tests/matcher/test_matcher_api.py:23–34  ·  view source on GitHub ↗
(en_vocab)

Source from the content-addressed store, hash-verified

21
22
23def test_matcher_from_api_docs(en_vocab):
24 matcher = Matcher(en_vocab)
25 pattern = [{"ORTH": "test"}]
26 assert len(matcher) == 0
27 matcher.add("Rule", [pattern])
28 assert len(matcher) == 1
29 matcher.remove("Rule")
30 assert "Rule" not in matcher
31 matcher.add("Rule", [pattern])
32 assert "Rule" in matcher
33 on_match, patterns = matcher.get("Rule")
34 assert len(patterns[0])
35
36
37def test_matcher_empty_patterns_warns(en_vocab):

Callers

nothing calls this directly

Calls 3

addMethod · 0.45
removeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…