mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-01 18:33:12 +03:00
Cherry-pick is_empty() fix. Drop KnowledgeBase.__len()__.
This commit is contained in:
parent
604cec0140
commit
14b22b9d65
|
@ -123,10 +123,10 @@ cdef class KnowledgeBase:
|
||||||
Errors.E1044.format(parent="KnowledgeBase", method="generate_from_disk", name=cls.__name__)
|
Errors.E1044.format(parent="KnowledgeBase", method="generate_from_disk", name=cls.__name__)
|
||||||
)
|
)
|
||||||
|
|
||||||
def __len__(self) -> int:
|
def is_empty(self) -> bool:
|
||||||
"""Returns number of entities in the KnowledgeBase.
|
"""Returns whether KnowledgeBase is empty.
|
||||||
RETURNS (int): Number of entities in the KnowledgeBase.
|
RETURNS (bool): Whether KnowledgeBase is empty.
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
Errors.E1044.format(parent="KnowledgeBase", method="__len__", name=self.__name__)
|
Errors.E1044.format(parent="KnowledgeBase", method="is_empty", name=self.__name__)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user