|
__init__(self,
features=( *slash*, *type*) ,
fdict_class=<class 'nltk.featstruct.FeatStruct'>,
flist_class=<class 'nltk.featstruct.FeatList'>)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
parse(self,
s,
fstruct=None)
Convert a string representation of a feature structure (as displayed
by repr) into a FeatStruct . |
source code
|
|
|
partial_parse(self,
s,
position=0,
reentrances=None,
fstruct=None)
Helper function that parses a feature structure. |
source code
|
|
|
_partial_parse(self,
s,
position,
reentrances,
fstruct=None) |
source code
|
|
|
_partial_parse_featlist(self,
s,
position,
match,
reentrances,
fstruct) |
source code
|
|
|
_partial_parse_featdict(self,
s,
position,
match,
reentrances,
fstruct) |
source code
|
|
|
_finalize(self,
s,
pos,
reentrances,
fstruct)
Called when we see the close brace -- checks for a slash feature, and
adds in default values. |
source code
|
|
|
_parse_value(self,
name,
s,
position,
reentrances) |
source code
|
|
|
parse_value(self,
s,
position,
reentrances) |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|
|
parse_fstruct_value(self,
s,
position,
reentrances,
match) |
source code
|
|
|
parse_str_value(self,
s,
position,
reentrances,
match) |
source code
|
|
|
parse_int_value(self,
s,
position,
reentrances,
match) |
source code
|
|
|
parse_var_value(self,
s,
position,
reentrances,
match) |
source code
|
|
|
parse_sym_value(self,
s,
position,
reentrances,
match) |
source code
|
|
|
parse_app_value(self,
s,
position,
reentrances,
match)
Mainly included for backwards compat. |
source code
|
|
|
parse_logic_value(self,
s,
position,
reentrances,
match) |
source code
|
|
|
parse_tuple_value(self,
s,
position,
reentrances,
match) |
source code
|
|
|
parse_set_value(self,
s,
position,
reentrances,
match) |
source code
|
|
|
_parse_seq_value(self,
s,
position,
reentrances,
match,
close_paren,
seq_class,
plus_class)
Helper function used by parse_tuple_value and parse_set_value. |
source code
|
|
|
_START_FSTRUCT_RE = re.compile(r'\s* (?: \(( \d+ ) \)\s* ) ? ( \?? [ \w-] ...
|
|
_END_FSTRUCT_RE = re.compile(r'\s* \]\s* ')
|
|
_SLASH_RE = re.compile(r'/')
|
|
_FEATURE_NAME_RE = re.compile(r'\s* ( [ \+-] ? ) ( [ ^ \s\(\)<>"\'-=\[\...
|
|
_REENTRANCE_RE = re.compile(r'\s* ->\s* ')
|
|
_TARGET_RE = re.compile(r'\s* \(( \d+ ) \)\s* ')
|
|
_ASSIGN_RE = re.compile(r'\s* =\s* ')
|
|
_COMMA_RE = re.compile(r'\s* ,\s* ')
|
|
_BARE_PREFIX_RE = re.compile(r'\s* (?: \(( \d+ ) \)\s* ) ? ( \?? [ \w-] + \...
|
|
_START_FDICT_RE = re.compile(r'( \s* (?: \(( \d+ ) \)\s* ) ? ( \?? [ \w-] + ...
|
|
VALUE_HANDLERS = [ ( ' parse_fstruct_value ' , re.compile(r'\s* (?: \...
A table indicating how feature values should be parsed.
|
|
_SYM_CONSTS = { ' False ' : False, ' None ' : None, ' True ' : True}
|