MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / __contains__

Method __contains__

numpy_ml/preprocessing/nlp.py:1068–1070  ·  view source on GitHub ↗

Assert whether `word` is a token in the vocabulary

(self, word)

Source from the content-addressed store, hash-verified

1066 return iter(self._tokens)
1067
1068 def __contains__(self, word):
1069 """Assert whether `word` is a token in the vocabulary"""
1070 return word in self.token2idx
1071
1072 def __getitem__(self, key):
1073 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected