PCFG (2)Up one level
Based on Haskell: Code for PCFG with inside algorithm design a (slightly) more realistic PCFG with a (slightly) larger vocabulary and implement it as a PCFG.
Use totalProb' to check your grammar's probabilities.
Create example term sequences and determine their probability with readOutBeta'.
Draw parse trees for ambiguous results.