| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
featurestructure.FeatureStructure --+
|
object --+ |
| |
cfg.Nonterminal --+
|
Category
A Category is a specialized feature structure, intended
for use in parsing. It can act as a Nonterminal.
A Category differs from a FeatureStructure
in these ways:
repr() representation of a Category, the head goes
to the left, on the outside of the brackets. Subclasses of
Category may change the feature name that is designated
as the head, which is _head by default.
Category may contain a list of required
features, which are names of features whose value is None if
unspecified. A Category lacking a feature that is required in it will
not unify with any Category that has that feature. If a required
feature's value is None, it is considered to be not
present. (Mixing different subclasses of Category is
probably a bad idea.)
True and False are allowed as values. A
feature named foo with a value of True is
simply expressed as +foo. Similarly, if it is
False, it is expressed as -foo.
|
|||
|
Inherited from |
|||
|
|||
|
|||
|
|||
|
|||
| Nonterminal |
|
||
bool
|
|
||
boolean
|
|
||
|
|||
|
|||
bool
|
|
||
|
|||
Category
|
|
||
str or None
|
|
||
|
|||
list of FeatureStructure
|
|
||
list of string
|
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
headname =
|
|||
requiredFeatures =
|
|||
_PARSE_RE =
|
|||
k =
|
|||
v = re.compile(r'\s
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
|||
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
|
|
|
|
|
hash(x)
|
Freezing a Category memoizes its hash value, to make comparisons on it faster. After freezing, the Category and all its values are immutable.
|
|
|
|
|
|
Attempt to unify
|
Display a single-line representation of this feature structure, suitable for embedding in other representations.
|
|
|
Helper function that parses a feature value. Currently supports: None, bools, integers, variables, strings, nested feature structures.
|
Helper function that parses a Category.
|
Parse a
where
|
|
|||
_PARSE_RE
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Wed May 16 22:47:29 2007 | http://epydoc.sourceforge.net |