whatisinternet / Inflector

A rust inflection library
https://docs.rs/Inflector
BSD 2-Clause "Simplified" License
124 stars 28 forks source link

Fix some irregular pluralizations #73

Open AndrewRadev opened 5 years ago

AndrewRadev commented 5 years ago

What it does:

Fixes the pluralization of "people" to "person" instead of "personople".

Why it does it:

Submatch 1 was the entire group starting with (\w* and wrapping the whole word. Moving the closing bracket to limit submatch 1 to just the \w*pe part seems to avoid the problem. There might be alternative fixes (get the second group rather than the first in some cases?), but I've tried to patch the problem with minimal changes to avoid causing unrelated bugs.

I've also added a few more tests, but I feel like pluralization in particular could use a lot more testing, just in case. It's one of those things that feel like they have a lot of edge cases that might break with changes to the rules.

winstonewert commented 4 years ago

I just came across this issue myself with "person" becoming "personople"

Sadly, it doesn't look like any action is happening to incorporate this fix.

mainrs commented 4 years ago

The author hasn't been on GitHub for more than a year now. Sad that such useful crates kind of get lost. Do other people than @whatisinternet have push access (and publishing rights)?

sezna commented 3 years ago

@mainrs I have a dependency on this crate, so I've forked it and am making updates there. I'll bring in this PR as well as a few others.

droundy commented 2 years ago

@sezna can you share where your fork is?