probabilistic CKY parsing in Python