Skip to content

Commit

Permalink
Return empty string for empty string input
Browse files Browse the repository at this point in the history
Before this change single letter 's' was returned instead.

fixes #19

Change-Id: Ib1a369fc3e0fd323fb7d3855ef1c7174621a5dee
  • Loading branch information
sentinelt committed Jul 7, 2021
1 parent ab038ff commit db746dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/atteo/evo/inflector/English.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ public English(MODE mode) {
categoryRule(CATEGORY_A_ATA, "", "es");

rule("s$", "ses");

// Return empty string for empty string input
rule("^$", "");
// Otherwise, assume that the plural just adds -s
rule("$", "s");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public void exampleWordList() {
{ "todo", "todos"},
{ "person", "persons"},
{ "baculumulum", "baculumula" }, // https://github.com/atteo/evo-inflector/pull/18
{ "", "" }
});
}

Expand Down

0 comments on commit db746dc

Please sign in to comment.