Package nltk :: Package sem :: Module evaluate :: Class Valuation
[hide private]
[frames] | no frames]

Class Valuation

source code

object --+    
         |    
      dict --+
             |
            Valuation

A dictionary which represents a model-theoretic Valuation of non-logical constants. Keys are strings representing the constants to be interpreted, and values correspond to individuals (represented as strings) and n-ary relations (represented as sets of tuples of strings).

An instance of Valuation will raise a KeyError exception (i.e., just behave like a standard dictionary) if indexed with an expression that is not in its list of symbols.

Instance Methods [hide private]
new empty dictionary

__init__(self, iter)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__getitem__(self, key)
x[y]
source code
 
read(*args, **kwargs) source code
 
__str__(self)
str(x)
source code
 
_getDomain(self) source code
 
_getSymbols(self) source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]
  domain
Set-theoretic domain of the value-space of a Valuation.
  symbols
The non-logical constants which the Valuation recognizes.

Inherited from object: __class__

Method Details [hide private]

__init__(self, iter)
(Constructor)

source code 

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

Parameters:
  • iter - a list of (symbol, value) pairs.
Returns:
new empty dictionary

Overrides: dict.__init__

__getitem__(self, key)
(Indexing operator)

source code 

x[y]

Overrides: dict.__getitem__
(inherited documentation)

read(*args, **kwargs)

source code 
Decorators:
  • @deprecated("Call the valuation as an initialization parameter instead")

Deprecated: Call the valuation as an initialization parameter instead

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

Property Details [hide private]

domain

Set-theoretic domain of the value-space of a Valuation.

Get Method:
_getDomain(self)

symbols

The non-logical constants which the Valuation recognizes.

Get Method:
_getSymbols(self)