Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singularize() throws IndexOutOfRangeException #1219

Closed
terrajobst opened this issue Aug 24, 2022 · 4 comments
Closed

Singularize() throws IndexOutOfRangeException #1219

terrajobst opened this issue Aug 24, 2022 · 4 comments

Comments

@terrajobst
Copy link

terrajobst commented Aug 24, 2022

This code results in an exception:

"S".Singularize();

Exception:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Humanizer.Inflections.Vocabulary.MatchUpperCase(String word, String replacement) in /_/src/Humanizer/Inflections/Vocabulary.cs:line 158
   at Humanizer.Inflections.Vocabulary.ApplyRules(IList`1 rules, String word, Boolean skipFirstRule) in /_/src/Humanizer/Inflections/Vocabulary.cs:line 148
   at Humanizer.Inflections.Vocabulary.Singularize(String word, Boolean inputIsKnownToBePlural, Boolean skipSimpleWords) in /_/src/Humanizer/Inflections/Vocabulary.cs:line 114
@neilboyd
Copy link
Contributor

Fixed in #1154

@terrajobst
Copy link
Author

terrajobst commented Mar 12, 2024

The bug is still present. Please not that this isn't the lower-case letter 's' but the upper case letter 'S'.

Edit Nevermind, just read that the fix wasn't published yet.

@SimonCropp
Copy link
Collaborator

@terrajobst if u have time, you could try the beta https://www.nuget.org/packages/Humanizer/3.0.0-beta.13

@terrajobst
Copy link
Author

Just did, seems to have fixed the issue.

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

No branches or pull requests

4 participants