A blackboard for hypotheses about the syntactic constituents of a
sentence. A chart contains a set of edges, and each edge encodes a
single hypothesis about the structure of some portion of the
sentence.
In order to reconstruct the trees that are represented by an edge, the
chart associates each edge with a set of child pointer lists. A child pointer
list is a list of the edges that license an edge's right-hand
side.
|
|
int
|
|
string
|
leaf(self,
index)
Returns:
The leaf value of the word at the given index. |
source code
|
|
list of string
|
leaves(self)
Returns:
A list of the leaf values of each word in the chart's sentence. |
source code
|
|
list of EdgeI
|
|
iter of EdgeI
|
|
iter of EdgeI
|
|
int
|
|
iter of EdgeI
|
select(self,
**restrictions)
Returns:
An iterator over the edges in this chart. |
source code
|
|
|
_add_index(self,
restr_keys)
A helper function for select, which creates a new index for a given set of
attributes (aka restriction keys). |
source code
|
|
bool
|
|
|
parses(self,
root,
tree_class=<class 'nltk.tree.Tree'>)
Returns:
A list of the complete tree structures that span the entire chart,
and whose root node is root . |
source code
|
|
list of Tree
|
trees(self,
edge,
tree_class=<class 'nltk.tree.Tree'>,
complete=False)
Returns:
A list of the tree structures that are associated with
edge . |
source code
|
|
|
|
|
|
list of list of EdgeI
|
|
string
|
pp_edge(self,
edge,
width=None)
Returns:
A pretty-printed string representation of a given edge in this chart. |
source code
|
|
|
pp_leaves(self,
width=None)
Returns:
A pretty-printed string representation of this chart's leaves. |
source code
|
|
string
|
pp(self,
width=None)
Returns:
A pretty-printed string representation of this chart. |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|