Package nltk :: Package inference :: Module resolution :: Class BindingDict
[hide private]
[frames] | no frames]

type BindingDict

source code

object --+
         |
        BindingDict

Instance Methods [hide private]
 
__init__(self, binding_list=None) source code
 
__setitem__(self, variable, binding)
A binding is consistent with the dict if its variable is not already bound, OR if its variable is already bound to its argument.
source code
 
__getitem__(self, variable)
Return the expression to which 'variable' is bound
source code
 
__contains__(self, item) source code
 
__add__(self, other)
Returns: BindingDict A new dict containing all the elements of both parameters
source code
 
__len__(self) source code
 
__str__(self) source code
 
__repr__(self) source code
Method Details [hide private]

__init__(self, binding_list=None)
(Constructor)

source code 
Parameters:
  • binding_list - list of (AbstractVariableExpression, AtomicExpression) to initialize the dictionary
Overrides: object.__init__

__setitem__(self, variable, binding)
(Index assignment operator)

source code 

A binding is consistent with the dict if its variable is not already bound, OR if its variable is already bound to its argument.

Parameters:
  • variable - Variable The variable to bind
  • binding - Expression The atomic to which 'variable' should be bound
Raises:

__add__(self, other)
(Addition operator)

source code 
Parameters:
  • other - BindingDict The dict with which to combine self
Returns:
BindingDict A new dict containing all the elements of both parameters
Raises:
  • BindingException - If the parameter dictionaries are not consistent with each other

__str__(self)
(Informal representation operator)

source code 
Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 
Overrides: object.__repr__
(inherited documentation)