Package nltk :: Package parse :: Module earleychart :: Class IncrementalChart
[hide private]
[frames] | no frames]

type IncrementalChart

source code

 object --+    
          |    
chart.Chart --+
              |
             IncrementalChart
Known Subclasses:

Instance Methods [hide private]
 
initialize(self)
Clear the chart.
source code
list of EdgeI
edges(self)
Returns: A list of all edges in this chart.
source code
iter of EdgeI
iteredges(self)
Returns: An iterator over the edges in this chart.
source code
iter of EdgeI
select(self, end, **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
 
_register_with_indexes(self, edge)
A helper function for insert, which registers the new edge with all existing indexes.
source code
 
_append_edge(self, edge) source code
 
_positions(self) source code

Inherited from chart.Chart: __init__, __iter__, child_pointer_lists, dot_digraph, insert, insert_with_backpointer, leaf, leaves, num_edges, num_leaves, parses, pp, pp_edge, pp_leaves, trees

Inherited from chart.Chart (private): _choose_children, _trees

Instance Variables [hide private]
Method Details [hide private]

initialize(self)

source code 

Clear the chart.

Overrides: chart.Chart.initialize
(inherited documentation)

edges(self)

source code 
Returns: list of EdgeI
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.
Overrides: chart.Chart.edges
(inherited documentation)

iteredges(self)

source code 
Returns: iter of EdgeI
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.
Overrides: chart.Chart.iteredges
(inherited documentation)

select(self, end, **restrictions)

source code 
Parameters:
  • span - Only generate edges e where e.span()==span
  • start - Only generate edges e where e.start()==start
  • end - Only generate edges e where e.end()==end
  • 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
  • next - Only generate edges e where e.next()==next
  • dot - Only generate edges e where e.dot()==dot
  • is_complete - Only generate edges e where e.is_complete()==is_complete
  • is_incomplete - Only generate edges e where e.is_incomplete()==is_incomplete
Returns: iter of EdgeI
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.
Overrides: chart.Chart.select
(inherited documentation)

_add_index(self, restr_keys)

source code 

A helper function for select, which creates a new index for a given set of attributes (aka restriction keys).

Overrides: chart.Chart._add_index
(inherited documentation)

_register_with_indexes(self, edge)

source code 

A helper function for insert, which registers the new edge with all existing indexes.

Overrides: chart.Chart._register_with_indexes
(inherited documentation)

_append_edge(self, edge)

source code 
Overrides: chart.Chart._append_edge