diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-10-14 20:15:17 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-10-14 20:15:17 -0400 |
| commit | 004bc5de7618bc44079e6cdd21a50d6814c76c50 (patch) | |
| tree | 3cbcc77bf04c7dae4c8ad3d745d181d4bfca77fb /src/main/java/bjc/inflexion/EnglishUtils.java | |
| parent | b09885e13d8829ee59e10ec0a957f6209c3e4aeb (diff) | |
General update
Testing, plus some reorganization
Diffstat (limited to 'src/main/java/bjc/inflexion/EnglishUtils.java')
| -rw-r--r-- | src/main/java/bjc/inflexion/EnglishUtils.java | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/main/java/bjc/inflexion/EnglishUtils.java b/src/main/java/bjc/inflexion/EnglishUtils.java index 1a399be..cee804d 100644 --- a/src/main/java/bjc/inflexion/EnglishUtils.java +++ b/src/main/java/bjc/inflexion/EnglishUtils.java @@ -22,58 +22,6 @@ import java.util.regex.Pattern; * @author student */ public class EnglishUtils { - private static String[] smallNums = new String[] { - "zero", "one", "two", "three", "four", "five", "six", "seven", - "eight", "nine", "ten" }; - - private static String[] summaryNums = new String[] { "no", "one", "a couple of", "a few", "several" }; - - private static int[] summaryMap = new int[] { - /* no */ - 0, - /* one */ - 1, - /* a couple of */ - 2, - /* a few */ - 3, 3, 3, - /* several */ - 4, 4, 4, 4 - }; - - /** - * Convert small integers to words. - * - * @param num - * The number to convert. - * - * @return - * The word for the number, if it's less than ten. - */ - public static String smallIntToWord(final int num) { - if (num >= 0 && num <= 10) return smallNums[num]; - - return Integer.toString(num); - } - - /** - * Summarize an integer. - * - * @param num - * The number to summarize. - * - * @param atEnd - * Whether or not the integer is at the end of a string. - * - * @return - * A string summarizing the integer. - */ - public static String intSummarize(final int num, final boolean atEnd) { - if (num >= 0 && num < 10) return summaryNums[summaryMap[num]]; - - return "many"; - } - /** * Pick an indefinite article ('a' or 'an') for a phrase. * @param phrase The phrase to pick an article for. |
