Implementation of the em-algorithm for PCFGs (inside-outside-algorithm)