mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Make PhraseMatcher.vocab consistent with Matcher.vocab (closes #4373)
This commit is contained in:
parent
e7ddc6f662
commit
fec9433044
|
@ -9,7 +9,7 @@ from ..vocab cimport Vocab
|
||||||
|
|
||||||
|
|
||||||
cdef class PhraseMatcher:
|
cdef class PhraseMatcher:
|
||||||
cdef Vocab vocab
|
cdef readonly Vocab vocab
|
||||||
cdef attr_id_t attr
|
cdef attr_id_t attr
|
||||||
cdef object _callbacks
|
cdef object _callbacks
|
||||||
cdef object _docs
|
cdef object _docs
|
||||||
|
|
13
spacy/tests/regression/test_issue4373.py
Normal file
13
spacy/tests/regression/test_issue4373.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# coding: utf8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from spacy.matcher import Matcher, PhraseMatcher
|
||||||
|
from spacy.vocab import Vocab
|
||||||
|
|
||||||
|
|
||||||
|
def test_issue4373():
|
||||||
|
"""Test that PhraseMatcher.vocab can be accessed (like Matcher.vocab)."""
|
||||||
|
matcher = Matcher(Vocab())
|
||||||
|
assert isinstance(matcher.vocab, Vocab)
|
||||||
|
matcher = PhraseMatcher(Vocab())
|
||||||
|
assert isinstance(matcher.vocab, Vocab)
|
Loading…
Reference in New Issue
Block a user