Package nltk :: Package parse :: Module featurechart :: Class FeatureChart
[hide private]
[frames] | no frames]

type FeatureChart

source code

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

A Chart for feature grammars.


See Also: Chart for more information.

Instance Methods [hide private]
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
 
_register_with_indexes(self, edge)
A helper function for insert, which registers the new edge with all existing indexes.
source code
 
_get_type_if_possible(self, item)
Helper function which returns the TYPE feature of the item, if it exists, otherwise it returns the item itself
source code
 
parses(self, start, 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

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

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

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

select(self, **restrictions)

source code 

Returns an iterator over the edges in this chart. See Chart.select for more information about the restrictions on the edges.

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

_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

_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

parses(self, start, tree_class=<class 'nltk.tree.Tree'>)

source code 
Returns:
A list of the complete tree structures that span the entire chart, and whose root node is root.
Overrides: chart.Chart.parses
(inherited documentation)