class documentation
class ProbabilisticTreeEdge(TreeEdge): (source)
Constructor: ProbabilisticTreeEdge(prob, *args, **kwargs)
Undocumented
Static Method | from |
Return 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. |
Method | __init__ |
Construct a new TreeEdge. |
Method | prob |
Undocumented |
Instance Variable | _comparison |
Undocumented |
Instance Variable | _prob |
Undocumented |
Inherited from TreeEdge
:
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | dot |
Return 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 tokens[self.start():self.end()]... |
Method | end |
Return the end index of this edge's span. |
Method | is |
Return True if this edge's structure is fully consistent with the text. |
Method | is |
Return True if this edge's structure is partially consistent with the text. |
Method | length |
Return the length of this edge's span. |
Method | lhs |
Return this edge's left-hand side, which specifies what kind of structure is hypothesized by this edge. |
Method | move |
Return a new TreeEdge formed from this edge. The new edge's dot position is increased by 1, and its end index will be replaced by new_end. |
Method | nextsym |
Return the element of this edge's right-hand side that immediately follows its dot. |
Method | rhs |
Return this edge's right-hand side, which specifies the content of the structure hypothesized by this edge. |
Method | span |
Return a tuple (s, e), where tokens[s:e] is the portion of the sentence that is consistent with this edge's structure. |
Method | start |
Return the start index of this edge's span. |
Instance Variable | _dot |
Undocumented |
Instance Variable | _lhs |
Undocumented |
Instance Variable | _rhs |
Undocumented |
Instance Variable | _span |
Undocumented |
Inherited from EdgeI
(via TreeEdge
):
Method | __eq__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __lt__ |
Undocumented |
Method | __ne__ |
Undocumented |
Instance Variable | _hash |
Undocumented |
Return 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.
Returns | |
TreeEdge | Undocumented |
overrides
nltk.parse.chart.TreeEdge.__init__
Construct a new TreeEdge.
Parameters | |
prob | Undocumented |
*args | Undocumented |
span:tuple(int, int) | A tuple (s, e), where tokens[s:e] is the portion of the sentence that is consistent with the new edge's structure. |
lhs:Nonterminal | The new edge's left-hand side, specifying the hypothesized tree's node value. |
rhs:list(Nonterminal and str) | The new edge's right-hand side, specifying the hypothesized tree's children. |
dot:int | 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 tokens in the sentence, then okens[span[0]:span[1]] can be spanned by the children specified by rhs[:dot]. |
**kwargs | Undocumented |