Skip to content

S singular fix#132

Open
jonmcoe wants to merge 9 commits intoclips:masterfrom
jonmcoe:s-singular-fix
Open

S singular fix#132
jonmcoe wants to merge 9 commits intoclips:masterfrom
jonmcoe:s-singular-fix

Conversation

@jonmcoe
Copy link
Copy Markdown

@jonmcoe jonmcoe commented Oct 18, 2015

change to logic for pluralization, singularization of some special groups
a few changes/additions to these groups
more tests

Comment thread pattern/text/en/inflect.py Outdated
if w.endswith(x+"s"):
return w
prefix = w[:w.find(x)]
return prefix+x
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I think it should have returned word and not w
  2. Isn't prefix = word[:w.find(x)]; return prefix+x just a complex version of return word[:-1]?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will change. i thought it captured the idea better (see how its exact same code at both sections you commented), more readable, etc. but your suggestion is def more concise and will run a bit faster

Comment thread pattern/text/en/inflect.py Outdated
for x in singular_s:
if w.endswith(x+"es"):
prefix = w[:w.find(x)]
return prefix+x
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants