diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-09-16 22:35:41 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-09-16 22:35:41 -0300 |
| commit | 5da4e3c87427abd7fee6457970399b06ceba2b98 (patch) | |
| tree | 3a0494cf27ebbd1259aa9911d31289316a136505 | |
| parent | a883e7d100c54451fb9256cb3867c2571ee4fff1 (diff) | |
Fix double-pluralizing
| -rw-r--r-- | src/main/java/bjc/inflexion/InflectionML.java | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/nouns/Noun.java | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/main/java/bjc/inflexion/InflectionML.java b/src/main/java/bjc/inflexion/InflectionML.java index 9ee175d..f1e7b00 100644 --- a/src/main/java/bjc/inflexion/InflectionML.java +++ b/src/main/java/bjc/inflexion/InflectionML.java @@ -175,7 +175,7 @@ public class InflectionML { if (optionSet.contains("c")) { nounVal = noun.classicalPlural(); } else { - nounVal = noun.modernPlural(); + nounVal = noun.plural(); } } else { nounVal = noun.singular(); 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); } } |
