Package nltk_lite :: Package parse :: Module chart :: Class LeafEdge
[show private | hide private]
[frames | no frames]

Type LeafEdge

object --+    
         |    
     EdgeI --+
             |
            LeafEdge

Known Subclasses:
ProbabilisticLeafEdge

An edge that records the fact that a leaf value is consistent with a word in the sentence. A leaf edge consists of: A leaf edge's left-hand side is its leaf value, and its right hand side is (). Its span is [index, index+1], and its dot position is 0.
Method Summary
  __init__(self, leaf, index)
Construct a new LeafEdge.
  __cmp__(self, other)
  __hash__(self)
  __repr__(self)
  __str__(self)
int dot(self)
Return this edge's dot position, which indicates how much of the hypothesized structure is consistent with the sentence.
int end(self)
Return the end index of this edge's span.
boolean is_complete(self)
Return true if this edge's structure is fully consistent with the text.
boolean is_incomplete(self)
Return true if this edge's structure is partially consistent with the text.
int length(self)
Return the length of this edge's span.
  lhs(self)
Return this edge's left-hand side, which specifies what kind of structure is hypothesized by this edge.
Nonterminal or terminal or None next(self)
Return the element of this edge's right-hand side that immediately follows its dot.
  rhs(self)
Return this edge's right-hand side, which specifies the content of the structure hypothesized by this edge.
(int, int) span(self)
Return a tuple (s,e), where subtokens[s:e] is the portion of the sentence that is consistent with this edge's structure.
int start(self)
Return the start index of this edge's span.
Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__

Method Details

__init__(self, leaf, index)
(Constructor)

Construct a new LeafEdge.
Parameters:
leaf - The new edge's leaf value, specifying the word that is recorded by this edge.
index - The new edge's index, specifying the position of the word that is recorded by this edge.
Overrides:
nltk_lite.parse.chart.EdgeI.__init__

dot(self)

Returns:
This edge's dot position, which indicates how much of the hypothesized structure is consistent with the sentence. In particular, self.rhs[:dot] is consistent with subtoks[self.start():self.end()].
           (type=int)
Overrides:
nltk_lite.parse.chart.EdgeI.dot (inherited documentation)

end(self)

Returns:
The end index of this edge's span.
           (type=int)
Overrides:
nltk_lite.parse.chart.EdgeI.end (inherited documentation)

is_complete(self)

Returns:
True if this edge's structure is fully consistent with the text.
           (type=boolean)
Overrides:
nltk_lite.parse.chart.EdgeI.is_complete (inherited documentation)

is_incomplete(self)

Returns:
True if this edge's structure is partially consistent with the text.
           (type=boolean)
Overrides:
nltk_lite.parse.chart.EdgeI.is_incomplete (inherited documentation)

length(self)

Returns:
The length of this edge's span.
           (type=int)
Overrides:
nltk_lite.parse.chart.EdgeI.length (inherited documentation)

lhs(self)

Returns:
This edge's left-hand side, which specifies what kind of structure is hypothesized by this edge.
Overrides:
nltk_lite.parse.chart.EdgeI.lhs (inherited documentation)

See Also: TreeEdge and LeafEdge for a description of the left-hand side values for each edge type.

next(self)

Returns:
The element of this edge's right-hand side that immediately follows its dot.
           (type=Nonterminal or terminal or None)
Overrides:
nltk_lite.parse.chart.EdgeI.next (inherited documentation)

rhs(self)

Returns:
This edge's right-hand side, which specifies the content of the structure hypothesized by this edge.
Overrides:
nltk_lite.parse.chart.EdgeI.rhs (inherited documentation)

See Also: TreeEdge and LeafEdge for a description of the right-hand side values for each edge type.

span(self)

Returns:
A tuple (s,e), where subtokens[s:e] is the portion of the sentence that is consistent with this edge's structure.
           (type=(int, int))
Overrides:
nltk_lite.parse.chart.EdgeI.span (inherited documentation)

start(self)

Returns:
The start index of this edge's span.
           (type=int)
Overrides:
nltk_lite.parse.chart.EdgeI.start (inherited documentation)

Generated by Epydoc 2.1 on Tue Sep 5 09:37:21 2006 http://epydoc.sf.net