summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/inflexion/NounInflector.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@mix.wvu.edu>2017-04-03 16:22:35 -0400
committerbjculkin <bjculkin@mix.wvu.edu>2017-04-03 16:22:35 -0400
commit3e20efa5625dd685e4989ff9f28833fd56cd962d (patch)
tree2b4d574b8f8e91770f2cb6c9e1bf46896c29cef5 /src/main/java/bjc/inflexion/NounInflector.java
parent71dab5c40a46632b11ef111ceb9d8beaa6281c22 (diff)
Work on inflection more
Diffstat (limited to 'src/main/java/bjc/inflexion/NounInflector.java')
-rw-r--r--src/main/java/bjc/inflexion/NounInflector.java69
1 files changed, 6 insertions, 63 deletions
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;
- }
}