Computer Science · Artificial Intelligence
Chapter 9 REGULAR APPROXIMATION OF CONTEXT-FREE GRAMMARS THROUGH TRANSFORMATION
Mehryar Mohri, Mark-jan Nederhof
See on the mapAbstract
Abstract We present an algorithm for approximating context-free languages with regular languages. The algorithm is based on a simple transformation that applies to any context-free grammar and guarantees that the result can be compiled into a finite automaton. The resulting grammar contains at most one new nonterminal for any nonterminal symbol of the input grammar. The result thus remains readable and if necessary modifiable. We extend the approximation algorithm to the case of weighted context-free grammars. We also report experiments with several grammars showing that the size of the minimal deterministic automata accepting the resulting approximations is of practical use for applications such as speech recognition. Despite the availability of extensive literature on the topic of efficient contextfree parsing, for large and very ambiguous grammars, context-free parsing poses a serious problem in many practical applications such as real-time speech recognition. For most grammars used in those applications, rules are annotated