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

Class InstantiateVarsChart

source code

 object --+    
          |    
chart.Chart --+
              |
             InstantiateVarsChart

A specialized chart that 'instantiates' variables whose names start with '@', by replacing them with unique new variables. In particular, whenever a complete edge is added to the chart, any variables in the edge's lhs whose names start with '@' will be replaced by unique new Variables.

Instance Methods [hide private]
 
__init__(self, tokens)
Construct a new empty chart.
source code
bool
insert(self, edge, child_pointer_list)
Add a new edge to the chart.
source code
 
instantiate_edge(self, edge) source code
 
inst_vars(self, edge) source code

Inherited from chart.Chart: __iter__, child_pointer_lists, dot_digraph, edges, iteredges, leaf, leaves, num_edges, num_leaves, parses, pp, pp_edge, pp_leaves, select, trees

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

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, tokens)
(Constructor)

source code 

Construct a new empty chart.

Parameters:
  • tokens - The sentence that this chart will be used to parse.
Overrides: chart.Chart.__init__
(inherited documentation)

insert(self, edge, child_pointer_list)

source code 

Add a new edge to the chart.

Parameters:
  • edge - The new edge
  • child_pointer_list - A list of the edges that were used to form this edge. This list is used to reconstruct the trees (or partial trees) that are associated with edge.
Returns: bool
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_list with edge.
Overrides: chart.Chart.insert
(inherited documentation)