A Scala parser for probabilistic context free grammar