Package nltk :: Module featstruct :: Class CustomFeatureValue
[hide private]
[frames] | no frames]

Class CustomFeatureValue

source code

object --+
         |
        CustomFeatureValue

An abstract base class for base values that define a custom unification method. A CustomFeatureValue's custom unification method will be used during feature structure unification if:

If two CustomFeatureValue objects are unified with one another during feature structure unification, then the unified base values they return must be equal; otherwise, an AssertionError will be raised.

Subclasses must define unify() and __cmp__(). Subclasses may also wish to define __hash__().

Instance Methods [hide private]
 
unify(self, other)
If this base value unifies with other, then return the unified value.
source code
 
__cmp__(self, other) source code
 
__hash__(self)
hash(x)
source code

Inherited from object: __delattr__, __getattribute__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

unify(self, other)

source code 

If this base value unifies with other, then return the unified value. Otherwise, return UnificationFailure.

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)