Content deleted Content added
Tag: Reverted |
Citation bot (talk | contribs) Removed URL that duplicated identifier. | Use this bot. Report bugs. | #UCB_CommandLine |
||
(7 intermediate revisions by 7 users not shown) | |||
Line 1:
{{Short description|Parsing algorithm for context-free grammars}}
{{Redirect|CYK||Cyk (disambiguation)}}
{{Infobox algorithm
|name=Cocke–Younger–Kasami algorithm (CYK)
Line 16 ⟶ 18:
==Standard form==
The [[dynamic programming]] algorithm requires the context-free grammar to be rendered into [[Chomsky normal form]] (CNF), because it tests for possibilities to split the current sequence into two smaller sequences. Any context-free grammar that does not generate the empty string can be represented in CNF using only [[Formal grammar#The syntax of grammars|production rules]] of the forms <math>A\rightarrow \alpha</math>
==Algorithm==
Line 40 ⟶ 42:
append <p,b,c> to ''back''[''l'',''s'',''a'']
'''if''' ''P''[n,''1'',''
''I'' is member of language
'''return''' ''back'' -- by ''retracing the steps through back, one can easily construct all possible parse trees of the string.''
Line 168 ⟶ 170:
==External links==
* [https://raw.org/tool/cyk-algorithm/ Interactive Visualization of the CYK algorithm]
* [https://martinlaz.github.io/demos/cky.html CYK parsing demo in JavaScript]
* [https://www.swisseduc.ch/informatik/exorciser/ Exorciser is a Java application to generate exercises in the CYK algorithm as well as Finite State Machines, Markov algorithms etc]
|