class documentation
class FeatStructReader(object): (source)
Constructor: FeatStructReader(features, fdict_class, flist_class, logic_parser)
Undocumented
Method | __init__ |
Undocumented |
Method | fromstring |
Convert a string representation of a feature structure (as displayed by repr) into a FeatStruct. This process imposes the following restrictions on the string representation: |
Method | read |
Mainly included for backwards compat. |
Method | read |
Undocumented |
Method | read |
Undocumented |
Method | read |
Undocumented |
Method | read |
Helper function that reads in a feature structure. |
Method | read |
Undocumented |
Method | read |
Undocumented |
Method | read |
Undocumented |
Method | read |
Undocumented |
Method | read |
Undocumented |
Method | read |
Undocumented |
Constant | VALUE |
Undocumented |
Method | _error |
Undocumented |
Method | _finalize |
Called when we see the close brace -- checks for a slash feature, and adds in default values. |
Method | _read |
Undocumented |
Method | _read |
Undocumented |
Method | _read |
Undocumented |
Method | _read |
Helper function used by read_tuple_value and read_set_value. |
Method | _read |
Undocumented |
Constant | _ASSIGN |
Undocumented |
Constant | _BARE |
Undocumented |
Constant | _COMMA |
Undocumented |
Constant | _END |
Undocumented |
Constant | _FEATURE |
Undocumented |
Constant | _REENTRANCE |
Undocumented |
Constant | _SLASH |
Undocumented |
Constant | _START |
Undocumented |
Constant | _START |
Undocumented |
Constant | _SYM |
Undocumented |
Constant | _TARGET |
Undocumented |
Instance Variable | _fdict |
Undocumented |
Instance Variable | _features |
Undocumented |
Instance Variable | _features |
Undocumented |
Instance Variable | _flist |
Undocumented |
Instance Variable | _logic |
Undocumented |
Instance Variable | _prefix |
Undocumented |
Instance Variable | _slash |
Undocumented |
def __init__(self, features=( SLASH, TYPE), fdict_class=FeatStruct, flist_class=FeatList, logic_parser=None):
(source)
¶
Undocumented
Convert a string representation of a feature structure (as displayed by repr) into a FeatStruct. This process imposes the following restrictions on the string representation:
- Feature names cannot contain any of the following: whitespace, parentheses, quote marks, equals signs, dashes, commas, and square brackets. Feature names may not begin with plus signs or minus signs.
- Only the following basic feature value are supported: strings, integers, variables, None, and unquoted alphanumeric strings.
- For reentrant values, the first mention must specify a reentrance identifier and a value; and any subsequent mentions must use arrows ('->') to reference the reentrance identifier.
Helper function that reads in a feature structure.
Parameters | |
s | The string to read. |
position | The position in the string to start parsing. |
reentrances | A dictionary from reentrance ids to values. Defaults to an empty dictionary. |
fstruct | Undocumented |
Returns | |
bool | A tuple (val, pos) of the feature structure created by parsing and the position where the parsed feature structure ends. |
Undocumented
Value |
|
def _read_seq_value(self, s, position, reentrances, match, close_paren, seq_class, plus_class):
(source)
¶
Helper function used by read_tuple_value and read_set_value.
Undocumented
Value |
|