CYK algorithm: Difference between revisions

Content deleted Content added
Teetooan (talk | contribs)
Generating a parse tree: Corrected style and technical error
Teetooan (talk | contribs)
Line 78:
==Extensions==
===Generating a parse tree===
The above algorithm is a [[recognizer]] that will only determine if a sentence is in the language. It is simple to extend it into a [[parser]] that also construct a [[parse tree]], by storing parse tree nodes as elements of the array, instead of booleans. Since the parsing process generates also unneeded subtrees that cannot be immediately known as such, it is necessary to store a list of of potential subtree roots (at list ome for each possible non-terminal, even if one wishes to only pick only one of the possible parse trees); the end result is then a shared-forest of possible parse trees. This shared forest can conveniently be read as a grammar generating only the sentence parsed, with any of the parse-trees corresponding to the original grammar, up to a very simple renaming of non-terminals.<ref name=harder>{{cite journal|last=Lang|first=Bernard|title=RECOGNITIONRecognition CANcan BEbe HARDERharder THANthan PARSINGparsing|journal=Computational Intelligence|date=November 1994|volume=10|issue=4|pages=486–494|url=http://citeseerx.ist.psu.edu/viewdoc/download?rep=rep1&type=pdf&doi=10.1.1.50.6982}}</ref>
 
An alternative formulation employs a second table B[n,n,r] of so-called ''backpointers''.