A structured set of features. These features are represented as a
mapping from feature names to feature values, where each feature value is
either a basic value (such as a string or an integer), or a nested
feature structure.
Feature structures may contain reentrant feature values. A reentrant
feature value is a single feature value that can be accessed via
multiple feature paths.
|
__init__(self,
**features)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
list of string
|
feature_names(self)
Returns:
A list of the names of the features whose values are defined by this
feature structure. |
source code
|
|
|
equal_values(self,
other,
check_reentrance=True)
Returns:
True if self and other assign the same
value to to every feature. |
source code
|
|
|
|
|
|
|
|
list of FeatureStructure
|
reentrances(self)
Returns:
A list of all feature structures that can be reached from
self by multiple feature paths. |
source code
|
|
FeatureStructure
|
apply_bindings(self,
bindings)
Returns:
The feature structure that is obtained by replacing each variable
bound by bindings with its values. |
source code
|
|
FeatureStructure
|
rename_variables(self,
newvars=None)
Returns:
The feature structure that is obtained by replacing each variable in
this feature structure with a new variable that has a unique
identifier. |
source code
|
|
|
|
|
|
|
unify(self,
other,
bindings=None,
trace=True)
Unify self with other , and return the
resulting feature structure. |
source code
|
|
|
|
|
_apply_forwards_to_bindings(self,
bindings)
Replace any feature structure that has a forward pointer with the
target of its forward pointer (to preserve reentrancy). |
source code
|
|
|
_apply_forwards(self,
visited)
Replace any feature structure that has a forward pointer with the
target of its forward pointer (to preserve reentrancy). |
source code
|
|
|
_rebind_aliased_variables(self,
bindings,
visited) |
source code
|
|
|
subsumes(self,
other)
Check if this feature structure subsumes another feature structure. |
source code
|
|
|
__repr__(self)
Display a single-line representation of this feature structure,
suitable for embedding in other representations. |
source code
|
|
|
__str__(self)
Display a multi-line representation of this feature structure as an
FVM (feature value matrix). |
source code
|
|
|
_repr(self,
reentrances,
reentrance_ids)
Returns:
A string representation of this feature structure. |
source code
|
|
|
_str(self,
reentrances,
reentrance_ids)
Returns:
A list of lines composing a string representation of this feature
structure. |
source code
|
|
|
_find_reentrances(self,
reentrances)
Find all of the feature values contained by self that are reentrant
(i.e., that can be reached by multiple paths through feature
structure's features). |
source code
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__
|