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

Class BindingDict

source code

object --+
         |
        BindingDict

Instance Methods [hide private]
 
__init__(self, binding_list=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
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)
str(x)
source code
 
__repr__(self)
repr(x)
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, binding_list=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • binding_list - list of (VariableExpression, 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 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)