class IncrementalChart(Chart): (source)
Known subclasses: nltk.parse.earleychart.FeatureIncrementalChart
Constructor: IncrementalChart(tokens)
Undocumented
Method | edges |
Return a list of all edges in this chart. New edges that are added to the chart after the call to edges() will not be contained in this list. |
Method | initialize |
Clear the chart. |
Method | iteredges |
Return an iterator over the edges in this chart. It is not guaranteed that new edges which are added to the chart before the iterator is exhausted will also be generated. |
Method | select |
Return an iterator over the edges in this chart. Any new edges that are added to the chart before the iterator is exahusted will also be generated. restrictions can be used to restrict the set of edges that will be generated. |
Method | _add |
A helper function for select, which creates a new index for a given set of attributes (aka restriction keys). |
Method | _append |
Undocumented |
Method | _positions |
Undocumented |
Method | _register |
A helper function for insert, which registers the new edge with all existing indexes. |
Instance Variable | _edge |
Undocumented |
Instance Variable | _edgelists |
Undocumented |
Instance Variable | _indexes |
Undocumented |
Inherited from Chart
:
Method | __init__ |
Construct a new chart. The chart is initialized with the leaf edges corresponding to the terminal leaves. |
Method | child |
Return the set of child pointer lists for the given edge. Each child pointer list is a list of edges that have been used to form this edge. |
Method | dot |
Undocumented |
Method | insert |
Add a new edge to the chart, and return True if this operation modified the chart. In particular, return true iff the chart did not already contain edge, or if it did not already associate child_pointer_lists... |
Method | insert |
Add a new edge to the chart, using a pointer to the previous edge. |
Method | leaf |
Return the leaf value of the word at the given index. |
Method | leaves |
Return a list of the leaf values of each word in the chart's sentence. |
Method | num |
Return the number of edges contained in this chart. |
Method | num |
Return the number of words in this chart's sentence. |
Method | parses |
Return an iterator of the complete tree structures that span the entire chart, and whose root node is root. |
Method | pretty |
Return a pretty-printed string representation of this chart. |
Method | pretty |
Return a pretty-printed string representation of a given edge in this chart. |
Method | pretty |
Return a pretty-printed string representation of this chart's leaves. This string can be used as a header for calls to pretty_format_edge. |
Method | trees |
Return an iterator of the tree structures that are associated with edge. |
Method | _trees |
A helper function for trees. |
Instance Variable | _edges |
A list of the edges in the chart |
Instance Variable | _num |
The number of tokens. |
Instance Variable | _tokens |
The sentence that the chart covers. |
nltk.parse.chart.Chart.edges
Return a list of all edges in this chart. New edges that are added to the chart after the call to edges() will not be contained in this list.
Returns | |
list(EdgeI) | Undocumented |
See Also | |
iteredges, select |
nltk.parse.chart.Chart.iteredges
Return an iterator over the edges in this chart. It is not guaranteed that new edges which are added to the chart before the iterator is exhausted will also be generated.
Returns | |
iter(EdgeI) | Undocumented |
See Also | |
edges, select |
nltk.parse.chart.Chart.select
nltk.parse.earleychart.FeatureIncrementalChart
Return an iterator over the edges in this chart. Any new edges that are added to the chart before the iterator is exahusted will also be generated. restrictions can be used to restrict the set of edges that will be generated.
Parameters | |
end | Only generate edges e where e.end()==end |
span | Only generate edges e where e.span()==span |
start | Only generate edges e where e.start()==start |
length | Only generate edges e where e.length()==length |
lhs | Only generate edges e where e.lhs()==lhs |
rhs | Only generate edges e where e.rhs()==rhs |
nextsym | Only generate edges e where e.nextsym()==nextsym |
dot | Only generate edges e where e.dot()==dot |
is | Only generate edges e where e.is_complete()==is_complete |
is | Only generate edges e where e.is_incomplete()==is_incomplete |
**restrictions | Undocumented |
Returns | |
iter(EdgeI) | Undocumented |
nltk.parse.chart.Chart._add_index
nltk.parse.earleychart.FeatureIncrementalChart
A helper function for select, which creates a new index for a given set of attributes (aka restriction keys).
nltk.parse.earleychart.FeatureIncrementalChart
A helper function for insert, which registers the new edge with all existing indexes.