Analysis of Equation Structure using Least Cost Parsing

R. Nigel Horspool, John Aycock · 2000

Mathematical equations represented in markup languages such as LaTeX and MathML are difficult to parse because the particular mathematical notation may not be known in advance. Parsing would be, for example, the first step before translation to another word processing format. A promising approach is to specify the equation language with an ambiguous grammar whose rules have associated cost expressions. The parse which yields the least cost would be the preferred parse. An implementation of least cost parsing, based on Earley's method, is described. If the cost expressions are restricted to functions that are monotonically non-decreasing with respect to each argument, the space of parsing possibilities may be pruned and the parsing method is efficient. If preprocessing of the grammar into a simplified form is permitted, the parser is as efficient as Earley's parsing method. 1 Introduction LaTeX [5] is a text markup language for specifying the formatting of a document. It is widely us...

Read the paper · More papers on PaperTik