MCPcopy Index your code
hub / github.com/clips/pattern / __contains__

Method __contains__

pattern/text/search.py:277–287  ·  view source on GitHub ↗
(self, term)

Source from the content-addressed store, hash-verified

275 return term
276
277 def __contains__(self, term):
278 # Check if the term is in the dictionary.
279 # If the term is not in the dictionary, check the classifiers.
280 term = self._normalize(term)
281 if dict.__contains__(self, term):
282 return True
283 for classifier in self.classifiers:
284 if classifier.parents(term) \
285 or classifier.children(term):
286 return True
287 return False
288
289 def append(self, term, type=None, value=None):
290 """ Appends the given term to the taxonomy and tags it as the given type.

Callers 3

classifyMethod · 0.45
dfsMethod · 0.45
removeMethod · 0.45

Calls 3

_normalizeMethod · 0.95
parentsMethod · 0.80
childrenMethod · 0.45

Tested by

no test coverage detected