mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 10:46:29 +03:00
Implement PhraseMatcher.__len__
This commit is contained in:
parent
7eebeeaf85
commit
9c733a8849
|
@ -471,7 +471,13 @@ cdef class PhraseMatcher:
|
||||||
self._callbacks = {}
|
self._callbacks = {}
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
raise NotImplementedError
|
"""Get the number of rules added to the matcher. Note that this only
|
||||||
|
returns the number of rules (identical with the number of IDs), not the
|
||||||
|
number of individual patterns.
|
||||||
|
|
||||||
|
RETURNS (int): The number of rules.
|
||||||
|
"""
|
||||||
|
return len(self.phrase_ids)
|
||||||
|
|
||||||
def __contains__(self, key):
|
def __contains__(self, key):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
Loading…
Reference in New Issue
Block a user