From 004bc5de7618bc44079e6cdd21a50d6814c76c50 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Sun, 14 Oct 2018 20:15:17 -0400 Subject: General update Testing, plus some reorganization --- src/main/java/bjc/inflexion/nouns/Noun.java | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (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 25cd04a..bfb7bb9 100644 --- a/src/main/java/bjc/inflexion/nouns/Noun.java +++ b/src/main/java/bjc/inflexion/nouns/Noun.java @@ -20,8 +20,6 @@ package bjc.inflexion.nouns; * @author EVE */ public class Noun { - /* Format string for toString. */ - private static final String TOSTRING_FMT = "Noun [word=%s, inflection=%s]"; /* The word itself. */ private final String word; /* Its inflection. */ @@ -81,6 +79,25 @@ public class Noun { return inflection.isPlural(word); } + /** + * Check whether or not this noun is uninflected (does not change in singular/plural). + * @return Whether or not the noun is uninflected. + */ + public boolean isUninflected() { + String singlar = singular(); + + if (singlar.equals(modernPlural()) || singlar.equals(classicalPlural())) return true; + + return false; + } + + /** + * Check if this noun has differing modern/classical plural forms. + * @return Whether this noun has differing plural forms. + */ + public boolean isDifferingPlural() { + return modernPlural().equals(classicalPlural()); + } /** * Get the singular form of this noun. * @@ -107,7 +124,7 @@ public class Noun { @Override public String toString() { - return String.format(TOSTRING_FMT, word, inflection); + return String.format("Noun [word=%s, inflection=%s]", word, inflection); } /** -- cgit v1.2.3