| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
list --+
|
offset_list.offsetList --+
|
CKYChart
A CKY chart is an offset list with some added chart specific methods. An offset list is a list with the indexing offset by 1: Where L[n] is the (n+1)th member of an ordinary Python list, it is the nth member of an offset list. >>> chart[n] returns all the entries for edges of length n in the chart. Thus chart indexes and length can be identified. >>> chart[n][m] returns a dictionary recording all the edges of length n beginning at position m in the string. Note positional list indices do begin with 0. >>> chart[6][0]['vp'] True means a there is a VP edge of length 6 beginning at 0 (the very beginning of the string).
The chart __init__ method requires a grammar, input and parser arguments. The length of the input determines maximum edge length and maximum start positions for each length. The grammar determines dictionary keys for edges of length 1. In accordance with the bottum-up CKY akgorithm, the chart is initialized with all edges of length of 1 as licensed by the input and grammar. This is done by the call to the add_length_one_edges method in __init__.
|
|||
| new list |
|
||
|
|||
|
Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Mon May 11 10:49:19 2009 | http://epydoc.sourceforge.net |