Skip to content

Bad assert in 2.3.8 Grand Slam  #16

Open

Description

@pcsiszar

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?

Activity

  1. DavidNemeskey commented on May 20, 2018

    @DavidNemeskey
    Collaborator
  2. pcsiszar commented on May 20, 2018

    @pcsiszar
    Author

    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

  3. DavidNemeskey commented on May 20, 2018

    @DavidNemeskey
    Collaborator
  4. DavidNemeskey commented on May 21, 2018

    @DavidNemeskey
    Collaborator

    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.

  5. pcsiszar commented on May 21, 2018

    @pcsiszar
    Author

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

  6. DavidNemeskey commented on May 22, 2018

    @DavidNemeskey
    Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions