Skip to content

Simplify first pass parse#7

Open
jpurma wants to merge 2 commits into
masterfrom
simplify-first-pass-parse
Open

Simplify first pass parse#7
jpurma wants to merge 2 commits into
masterfrom
simplify-first-pass-parse

Conversation

@jpurma
Copy link
Copy Markdown
Collaborator

@jpurma jpurma commented Oct 13, 2019

Proposing to simplify _first_pass_parse -method with three changes:

  1. Move final evaluation of a solution into its own method.
  2. Reduce indentation levels by having outmost for-loop continue into next iteration instead of closing the rest of the for-loop step in an else-part.
  3. Instead of using a lists of all words in a sentence and an index of the current word, use lists of the remaining words, and pop the first word of the list as the current word. Morphological parse is also modified to work without index. There was also a potential error found in existing code where morphological_parse always returned the first disambiguated lexical item if the morphology was simple, len(morphemes) == 1. See line 41 in old code: it returns lexical_item sense 0 even when the method was called with some other sense.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant