diff options
| author | student <student@192.168.1.186> | 2017-04-03 11:46:49 -0400 |
|---|---|---|
| committer | student <student@192.168.1.186> | 2017-04-03 11:46:49 -0400 |
| commit | 71dab5c40a46632b11ef111ceb9d8beaa6281c22 (patch) | |
| tree | 27f09ea8a46de4a464f55f6530bd5f250ad308f6 /src/main/java/bjc/inflexion/InflectionUtils.java | |
| parent | 741d09bfc2323ea97fd587542fe395aa2923883f (diff) | |
Start on noun inflection
Diffstat (limited to 'src/main/java/bjc/inflexion/InflectionUtils.java')
| -rw-r--r-- | src/main/java/bjc/inflexion/InflectionUtils.java | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/src/main/java/bjc/inflexion/InflectionUtils.java b/src/main/java/bjc/inflexion/InflectionUtils.java index 6ea0ac3..69e359d 100644 --- a/src/main/java/bjc/inflexion/InflectionUtils.java +++ b/src/main/java/bjc/inflexion/InflectionUtils.java @@ -29,10 +29,10 @@ public class InflectionUtils { * Returns true if the given word ends in the given suffix.
*
* @param word
- * The word to check.
+ * The word to check.
*
* @param suffix
- * The suffix to check for.
+ * The suffix to check for.
*
* @return Whether or not the provided word ends in the provided suffix.
*/
@@ -44,20 +44,19 @@ public class InflectionUtils { }
/**
- * Check if the given word inflects from the given singular suffix to
- * the given plural suffix.
+ * Check if the given word inflects from the given singular suffix to the
+ * given plural suffix.
*
* @param word
- * The word to check.
+ * The word to check.
*
* @param singular
- * The singular suffix.
+ * The singular suffix.
*
* @param plural
- * The plural suffix.
+ * The plural suffix.
*
- * @return Whether or not the provided word is in that inflection
- * category.
+ * @return Whether or not the provided word is in that inflection category.
*/
public static boolean category(String word, String singular, String plural) {
/*
@@ -67,11 +66,20 @@ public class InflectionUtils { }
/**
+ * Replace the provided singular suffix in the word with the given plural
+ * suffix.
*
* @param word
+ * The word to inflect.
+ *
* @param singular
+ * The singular suffix to remove.
+ *
* @param plural
- * @return
+ * The plural suffix to add. Unlike normal suffixes, this must be
+ * a '-' followed by a string.
+ *
+ * @return The word with the suffix replaced.
*/
public static String inflect(String word, String singular, String plural) {
/*
@@ -79,4 +87,22 @@ public class InflectionUtils { */
return null;
}
-}
+
+ /**
+ * Remove the specified suffix from the word.
+ *
+ * @param word
+ * The word to stem.
+ *
+ * @param suffix
+ * The suffix to remove from the word.
+ *
+ * @return The word with the suffix removed.
+ */
+ public static String stem(String word, String suffix) {
+ /*
+ * TODO implement me.
+ */
+ return null;
+ }
+}
\ No newline at end of file |
