bmeaut / python_nlp_2018_spring

MIT License
8 stars 10 forks source link

Bad assert in 2.3.8 Grand Slam #16

Open pcsiszar opened 6 years ago

pcsiszar commented 6 years ago

My code passes every assert except for one in the test: assert len(trees) == 11

Is there a particular reason why the trees parsed have to number 11? I copied every other assert from 2.3.8 and they all passed. What can be the underlying issue for less trees parsed?

DavidNemeskey commented 6 years ago

Which sentence?

On Sun, May 20, 2018, 15:08 pcsiszar notifications@github.com wrote:

My code passes every assert except for one in the test: assert len(trees) == 11

Is there a particular reason why the trees parsed have to number 11? I copied every other assert from 2.3.8 and they all passed. What can be the underlying issue for less trees parsed?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bmeaut/python_nlp_2018_spring/issues/16, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqI0jbEXKQOEZdS7ni_gfDzud2xpjBZks5t0WqvgaJpZM4UGEcV .

pcsiszar commented 6 years ago

tp = nltk.ChartParser(tp_grammar)

trees = list(tp.parse('mama pi mi mute o sina lon sewi kon'.split())) assert len(trees) == 11

This one

DavidNemeskey commented 6 years ago

I don't have access to a computer ATM, but I'll have a look tomorrow evening.

On Sun, May 20, 2018, 16:13 pcsiszar notifications@github.com wrote:

tp = nltk.ChartParser(tp_grammar)

trees = list(tp.parse('mama pi mi mute o sina lon sewi kon'.split())) assert len(trees) == 11

This one

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bmeaut/python_nlp_2018_spring/issues/16#issuecomment-390485912, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqI0mMmQ9HVPpfO3Pom2QGrPiEWxVwoks5t0XoBgaJpZM4UGEcV .

DavidNemeskey commented 6 years ago

My implementation returns 11 trees. Please attach a text file with the trees you have found print()-ed. We cannot discard the possibility that it is your implementation that is correct and mine is at fault.

pcsiszar commented 6 years ago

Here is my output, it numbers 5 trees. trees.txt

DavidNemeskey commented 6 years ago

You are missing the PPs! Otherwise your solution is completely fine, but both 5a and 5b contains optional prepositional phrase(s).