mirror of https://github.com/explosion/spaCy.git
make StringStore.__contains__() return True for the empty string (which is also contained in iteration)
This commit is contained in:
parent
f2cfbfc412
commit
f18805ee1c
|
@ -116,7 +116,9 @@ cdef class StringStore:
|
|||
else:
|
||||
raise TypeError(type(string_or_id))
|
||||
|
||||
def __contains__(self, unicode string):
|
||||
def __contains__(self, unicode string not None):
|
||||
if len(string) == 0:
|
||||
return True
|
||||
cdef hash_t key = hash_string(string)
|
||||
return self._map.get(key) is not NULL
|
||||
|
||||
|
|
Loading…
Reference in New Issue