Java Reference
In-Depth Information
for(Parse parse : parses) {
parse.show();
System.out.println("Probability: " + parse.getProb());
}
The output is as follows:
(TOP (S (NP (DT The) (NN cow)) (VP (VBD jumped) (PP (IN
over) (NP (DT the) (NN moon))))))
Probability: -1.043506016751117
(TOP (S (NP (DT The) (NN cow)) (VP (VP (VBD jumped) (PRT
(RP over))) (NP (DT the) (NN moon)))))
Probability: -4.248553665013661
(TOP (S (NP (DT The) (NNS cow)) (VP (VBD jumped) (PP (IN
over) (NP (DT the) (NN moon))))))
Probability: -4.761071294573854
Notice that each parse produces a slightly different order and assignment of tags. The fol-
lowing output shows the first parse formatted to make it easier to read:
(TOP
(S
(NP
(DT The)
(NN cow)
)
(VP
(VBD jumped)
(PP
(IN over)
(NP
(DT the)
(NN moon)
)
)
)
)
)
Search WWH ::




Custom Search