Package nltk :: Package parse :: Module pchart :: Class ProbabilisticTreeEdge
[hide private]
[frames] | no frames]

Class ProbabilisticTreeEdge

source code

 object --+        
          |        
chart.EdgeI --+    
              |    
 chart.TreeEdge --+
                  |
                 ProbabilisticTreeEdge

Instance Methods [hide private]
 
__init__(self, prob, *args, **kwargs)
Construct a new TreeEdge.
source code
 
prob(self) source code
 
__cmp__(self, other) source code

Inherited from chart.TreeEdge: __hash__, __repr__, __str__, dot, end, is_complete, is_incomplete, length, lhs, next, rhs, span, start

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__

Static Methods [hide private]
TreeEdge
from_production(production, index, p)
Returns: A new TreeEdge formed from the given production.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, prob, *args, **kwargs)
(Constructor)

source code 

Construct a new TreeEdge.

Parameters:
  • span - A tuple (s,e), where subtokens[s:e] is the portion of the sentence that is consistent with the new edge's structure.
  • lhs - The new edge's left-hand side, specifying the hypothesized tree's node value.
  • rhs - The new edge's right-hand side, specifying the hypothesized tree's children.
  • dot - The position of the new edge's dot. This position specifies what prefix of the production's right hand side is consistent with the text. In particular, if sentence is the list of subtokens in the sentence, then subtokens[span[0]:span[1]] can be spanned by the children specified by rhs[:dot].
Overrides: chart.TreeEdge.__init__
(inherited documentation)

__cmp__(self, other)
(Comparison operator)

source code 
Overrides: chart.TreeEdge.__cmp__

from_production(production, index, p)
Static Method

source code 
Returns: TreeEdge
A new TreeEdge formed from the given production. The new edge's left-hand side and right-hand side will be taken from production; its span will be (index, index); and its dot position will be 0.
Overrides: chart.TreeEdge.from_production
(inherited documentation)