From 5da4e3c87427abd7fee6457970399b06ceba2b98 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Sun, 16 Sep 2018 22:35:41 -0300 Subject: Fix double-pluralizing --- src/main/java/bjc/inflexion/nouns/Noun.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/main/java/bjc/inflexion/nouns/Noun.java') diff --git a/src/main/java/bjc/inflexion/nouns/Noun.java b/src/main/java/bjc/inflexion/nouns/Noun.java index cd7c855..25cd04a 100644 --- a/src/main/java/bjc/inflexion/nouns/Noun.java +++ b/src/main/java/bjc/inflexion/nouns/Noun.java @@ -88,6 +88,8 @@ public class Noun { * The singular form of this noun. */ public String singular() { + if (isSingular()) return word; + return inflection.singularize(word); } @@ -98,6 +100,8 @@ public class Noun { * The plural form of this noun. */ public String plural() { + if (isPlural()) return word; + return inflection.pluralize(word); } @@ -113,6 +117,14 @@ public class Noun { * The modern plural form of this noun. */ public String modernPlural() { + if (isPlural()) { + // @NOTE 9/16/18 + // + // Not sure if we're in modern/classical plural. Think + // if there's a better way to do this + return inflection.pluralizeModern(inflection.singularize(word)); + } + return inflection.pluralizeModern(word); } @@ -123,6 +135,14 @@ public class Noun { * The classical plural form of this noun. */ public String classicalPlural() { + if (isPlural()) { + // @NOTE 9/16/18 + // + // Not sure if we're in modern/classical plural. Think + // if there's a better way to do this + return inflection.pluralizeModern(inflection.singularize(word)); + } + return inflection.pluralizeClassical(word); } } -- cgit v1.2.3