This is an object oriented wrapper arround the C structure with the same name. All access to that C structure should be encapsulated by this class. All methods dealing directly with a C ParseStruct are called via this class.
Definition at line 25 of file parse.tcl.
Public Member Functions | |
getBadness () | |
getBindingAt (TclString levelId, TclNumber wordIndex) | |
getBindingById (TclString bindingId) | |
getBindings (TclString levelId) | |
getComment () | |
getCurrentReading (TclNumber wordIndex) | |
getDate () | |
getGrammarFiles () | |
getHeight (TclString levelId) | |
getId () | |
getLabels () | |
getLatticeId () | |
getLevels () | |
getLexemes () | |
getLexiconItem (TclNumber wordIndex) | |
getModifiee (TclString levelId, TclNumber wordIndex) | |
getModifiers (TclString levelId, TclNumber wordIndex) | |
getNoSolutions () | |
getScore () | |
getSearchStrategy () | |
getSolutionNo () | |
getUserName () | |
getValue (TclNumber wordIndex) | |
getViolations () | |
getWidth () | |
getWord (TclNumber wordIndex) | |
getWordDepth (TclString levelId, TclNumber wordInedx) | |
getWordHeight (TclString levelId, TclNumber wordInedx) | |
getWords () | |
indexOf (TclString levelId, TclNumber wordIndex) | |
init (Parse cpointer) | |
isAbstract () | |
isLeafNode (TclString levelId, TclNumber wordIndex) | |
mirror () | |
optimizeLabel (TclString levelId, TclNumber wordIndex) | |
optimizeStructure (TclNumber levelId, TclNumber wordIndex) | |
optimizeWord (TclNumber wordIndex) | |
Parse (TclList args) | |
register () | |
shiftEdge (TclString levelId, TclNumber wordIndex, TclNumber targetIndex) | |
swapLabel (TclString levelId, TclNumber wordIndex, TclString label) | |
swapWord (TclNumber wordIndex, TclString description) | |
toAnno () | |
verify () | |
Private Attributes | |
TclArray | _bindings |
TclNumber | _cpointer = 0 |
TclArray | _isLeafNode |
TclArray | _treeHeight |
TclArray | _wordDepth |
TclArray | _wordHeight |
|
constructor |
|
get the badness value of the current parse. This method computes the badness of the current parse by itself looking up its constraint violations. The badness is given as a list containing
|
|
get the binding at a position on a level. This is the lowest access function to the ParseStruct. All information retrieved from the ParseStruct is cached in Parse::_bindings for faster access. This cache only gets invalidated by swapWord(), swapLabel() or shiftEdge(). Thereby caching should be mostly transparent.
|
|
get the bindings of a given index. This comes done to the binding that is pointed to by a constraint violation. Its
|
|
get all bindings on a given level. This method retrieves all bindings of the unerlying Parse.
|
|
get the comment of the current parse. This is a getter method for the ParseStruct::comment.
|
|
Return the description of the word currently selected at the timepoint $wordIndex. Definition at line 576 of file parse.tcl. |
|
get the date of the current parse. This is a wrapper for parseDate() in the C layer.
|
|
get all grammar files. This gets all grammar files related to this parse, that is return the tcl-ized list of ParseStruct::grammarFiles.
|
|
get the height of the dependency tree on a given level. This method simply returns the parseHeight() of the current parse on the given level. Doing that it caches the result on the tcl layer for faster access. If the parse changes in structure (by shiftEdge()) this array gets invalidated again.
|
|
get the id of the current parse. This is a getter method for the ParseStruct::id
|
|
get all labels. This method collects all labels from ParseStruct::labels for you. Actually this should be only a fallback whenever we cannot ask the grammar for its labels.
|
|
get the lattice id. This method returns the |
|
Get all levels of the Parse. This method collects the ids of all levels contained in the current parse. So this is an easy accessor for ParseStruct::levels.
|
|
get all lexeme nodes of current parse. This method is only a wrapper for parseGetLexemNodes() converting the returned List into a TclList (I know this is lame)
|
|
Return the lexicon item currently selected at the timepoint $wordIndex. |
|
get the modifiee of a word on a level. This method lets you access the ParseStruct::verticesStruct easily.
|
|
get all modifiers of a word on a level. This method does not boil down to getBindingAt() as you would expect but sacrifies clean design for speed accessing the ParseStruct::verticesStruct directly retrieving what we want.
|
|
get the number of solutions. This is the number of solutions this parse is one of.
|
|
get the score of the current parse. This is a getter method for the ParseStruct::score.
|
|
get the search strategy. This method returns the information about the search strategy with which the current parse has been produced
|
|
get the solution number. This is the solution number identifying this parse as being one of several solutions.
|
|
get the user name. This method returns the user who created this parse. Definition at line 448 of file parse.tcl. |
|
Return a string representing the lexicon item currently selected at the timepoint $wordIndex. Definition at line 584 of file parse.tcl. |
|
get all violations of the current parse. Information is taken from the Parse::violations and then taken appart meticulously for you. We return a list of violations each with the following format in the following order:
|
|
get the number of words. Actually being a bad name for what it does this simply counts the number of words in the ParseStruct::words vector. Definition at line 548 of file parse.tcl. |
|
get a word from the parse. This method gets you the WordStruct at the given index
|
|
get maximum distance of reachable leaves. This method works using the same caching logic like getWordHeight() and all the other methods that retrieve numbers from the C layer caching them on the tcl layer.
|
|
Wrapper for parseWordHeight(). This method simply returns the parseWordHeight() of a word on a level in the current parse. Afterwards results are cached at the tcl layer. Occasionally shiftEdge() nullifies this again.
|
|
get the words Vector of the current parse. This method does not attempt to extract all words from the ParseStruct::words vector but returns the Vector itself.
|
|
Wrapper for parseIndex(). |
|
attach a C structure to this instance.
References error(). |
|
get the abstraction state of the current parse. This is a straight delegation to parseIsAbstract().
|
|
test whether a word on a given level is a leaf. This is done by examining the ParseStruct::verticesStruct storing the result into Parse::_isLeafNode at the index
|
|
compute the mirror edges. This is a straight delegation to parseMirror(). Note that all caches on the tcl layer are possibly invalidated now. Definition at line 748 of file parse.tcl. |
|
Wrapper for parseOptimizeLabel(). Definition at line 650 of file parse.tcl. |
|
Wrapper for parseOptimizeStructure(). Definition at line 664 of file parse.tcl. |
|
Wrapper for parseOptimizeWord(). Definition at line 657 of file parse.tcl. |
|
register the current parse to th C layer. This puts the C Parse into inputCurrentGrammar->parses. Actually this operation is blindly delegated to parseRegister(). Definition at line 739 of file parse.tcl. |
|
redirect a dependency edge to a new modifiee. This method uses parseShiftEdge() to do the actual work. Note that the arrays Parse::_wordHeight, Parse::_wordDepth, Parse::_bindings and Parse::_treeHeight are invalidated for this level.
|
|
exchange the label of a dependency edge. This method uses parseSwapLabel() to do the actual work. Note that the Parse::_bindings array is invalidated for this level.
|
|
exchange a word at a given index. This method uses parseSwapWord() to maniplulate the parse structure. Note that the Parse::_bindings array is invalidated completely here. Definition at line 629 of file parse.tcl. |
|
convert the current parse to an annotation. This is a straight delegation to parse2annotation(). Definition at line 761 of file parse.tcl. |
|
verify the current parse. This is method verifies the current parse using the first annotation linked to the same lattice, that is: this parse has a link to a lattice and there exist one or more annotations linked to this lattice; we take the first of them.
|
|
cache to speed up tree access. This hash stores all bindings for each level mapping
|
|
pointer to the C structure |
|
information about each word on each level. This has mapps the |
|
the height of each tree on each level. This hash mapps the
|
|
the depth of a word in a dependency tree on a level. This hash mapps
|
|
the height of a word in a dependency tree on a level. This hash mapps
|