Overview | 2.1 | 2.2 | 2.3 | 2.4 | 2.5 | 2.6

 

2.1 Parsing with a statistical grammar

Here is a statistical grammar which can be used for processing arithmetical expressions:

   0.20  EXP -> F LSQ EXP ]
   0.20  EXP -> E BIN E
   0.35  EXP -> x 
   0.15  EXP -> f
   0.10  EXP -> UN EXP
   0.20    E -> ( EXP )
   0.20    E -> F LSQ EXP ]
   0.20    E -> f
   0.40    E -> x
   0.90    F -> f
   0.10    F -> x
   0.25  BIN -> +
   0.25  BIN -> -
   0.25  BIN -> *
   0.25  BIN -> /
   1.00   UN -> -
   1.00  LSQ -> [

The grammar consists of a set of rules with probabilities. It can process expressions like x+x and -f[x]*(f-x) by selecting a set of rules and combine their probability scores to obtain a probability score for the expression. You can test this yourself by entering an expression in the following input field:

Press the parse button or hit return in order to make the grammar process your expression.


Last update: November 20, 2003. erikt@uia.ua.ac.be