From 3e20efa5625dd685e4989ff9f28833fd56cd962d Mon Sep 17 00:00:00 2001 From: bjculkin Date: Mon, 3 Apr 2017 16:22:35 -0400 Subject: Work on inflection more --- src/main/java/bjc/inflexion/NounInflector.java | 69 +++----------------------- 1 file changed, 6 insertions(+), 63 deletions(-) (limited to 'src/main/java/bjc/inflexion/NounInflector.java') diff --git a/src/main/java/bjc/inflexion/NounInflector.java b/src/main/java/bjc/inflexion/NounInflector.java index 8f839f4..5ba39fb 100644 --- a/src/main/java/bjc/inflexion/NounInflector.java +++ b/src/main/java/bjc/inflexion/NounInflector.java @@ -15,79 +15,22 @@ */ package bjc.inflexion; -import static bjc.inflexion.InflectionUtils.*; - /** - * Inflect English nouns. + * Inflect singular nouns to plural nouns. * - * @author student + * @author EVE * */ public class NounInflector { /** - * - */ - public static String inflectNoun(String noun) { - if (isUserPlural(noun)) { - return userPlural(noun); - } - - if (dontPluralize(noun)) - return noun; - - return ""; - } - - /** - * Check if a given noun shouldn't be pluralized. + * Inflect a singular noun to a plural form. * * @param noun - * The noun to check. + * The singular noun. * - * @return Whether or not the noun has no plural. + * @return The plural form of the noun. */ - private static boolean dontPluralize(String noun) { - String[] suffixes = new String[] { "-fish", "-ois", "-sheep", "-deer", "-pox", "-[A-Z].*ese", "-itis", }; - - for (String sfx : suffixes) { - if (suffix(noun, sfx)) - return true; - } - - if (category(noun, "", "")) - return true; - - return false; - } - - /** - * Inflect a noun according to a user-defined plural. - * - * @param noun - * The noun to inflect. - * - * @return The noun, inflected by the user form. - */ - private static String userPlural(String noun) { - /* - * TODO Auto-generated method stub - */ + public static String inflectNoun(String noun) { return null; } - - /** - * Check if there is a user defined plural form for the given noun. - * - * @param noun - * The noun to check. - * - * @return Whether or not a user-defined plural exists for a particular - * noun. - */ - private static boolean isUserPlural(String noun) { - /* - * TODO Auto-generated method stub - */ - return false; - } } -- cgit v1.2.3