MCPcopy
hub / github.com/nltk/nltk / add

Method add

nltk/sem/evaluate.py:367–377  ·  view source on GitHub ↗

Add a new variable-value pair to the assignment, and update ``self.variant``.

(self, var, val)

Source from the content-addressed store, hash-verified

365 return None
366
367 def add(self, var, val):
368 """
369 Add a new variable-value pair to the assignment, and update
370 ``self.variant``.
371
372 """
373 assert val in self.domain, f"{val} is not in the domain {self.domain}"
374 assert is_indvar(var), "Wrong format for an Individual Variable: '%s'" % var
375 self[var] = val
376 self._addvariant()
377 return self
378
379
380class Model:

Callers 15

find_deprecated_defsFunction · 0.45
print_deprecated_uses_inFunction · 0.45
_equalMethod · 0.45
_calculate_hashvalueMethod · 0.45
_freezeMethod · 0.45
_walkMethod · 0.45
_substitute_bindingsFunction · 0.45
_retract_bindingsFunction · 0.45
_variablesFunction · 0.45
_rename_variablesFunction · 0.45
_remove_variablesFunction · 0.45
_apply_forwardsFunction · 0.45

Calls 2

_addvariantMethod · 0.95
is_indvarFunction · 0.90

Tested by

no test coverage detected