Package nltk_lite :: Package semantics :: Module evaluate :: Class CharFun
[hide private]
[frames] | no frames]

Class CharFun

source code

object --+    
         |    
      dict --+
             |
            CharFun

A dictionary which represents a curryed characteristic function.

Instance Methods [hide private]
 
__init__(self, charfun=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_isrel(self, s)
Check whether a set represents a relation (of any arity).
source code
CharFun
_item2dict(self, item)
Given an input such as the triple ('a', 'b', 'c'), return the CharFun {'c': {'b': {'a' : True}}}
source code
 
_merge(self, chf1, chf2) source code
CharFun
read(self, s)
Convert an n-ary relation into its corresponding characteristic function.
source code
 
tuples(self)
Convert a CharFun back into a set of tuples.
source code
 
_getDomain(self) source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __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__, __str__

Properties [hide private]
  domain
Set-theoretic domain of a curried function

Inherited from object: __class__

Method Details [hide private]

__init__(self, charfun=None)
(Constructor)

source code 

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

Returns:
new empty dictionary

Overrides: dict.__init__
(inherited documentation)

_item2dict(self, item)

source code 

Given an input such as the triple ('a', 'b', 'c'), return the CharFun {'c': {'b': {'a' : True}}}

Parameters:
  • item - a literal or a tuple
Returns: CharFun
A characteristic function corresponding to the input.

read(self, s)

source code 

Convert an n-ary relation into its corresponding characteristic function.

Returns: CharFun

tuples(self)

source code 

Convert a CharFun back into a set of tuples.

Given an input such as the CharFun {'c': {'b': {'a': True}}}, return set([('a', 'b', 'c')])


Property Details [hide private]

domain

Set-theoretic domain of a curried function

Get Method:
_getDomain(self)