From 741d09bfc2323ea97fd587542fe395aa2923883f Mon Sep 17 00:00:00 2001 From: bjculkin Date: Mon, 3 Apr 2017 10:50:00 -0400 Subject: Work on utility functions --- .classpath | 15 +---- .settings/org.eclipse.jdt.core.prefs | 6 +- .settings/org.eclipse.jdt.ui.prefs | 3 + pom.xml | 35 ++++++++-- src/main/java/bjc/inflexion/InflectionUtils.java | 82 ++++++++++++++++++++++++ 5 files changed, 118 insertions(+), 23 deletions(-) create mode 100644 .settings/org.eclipse.jdt.ui.prefs create mode 100644 src/main/java/bjc/inflexion/InflectionUtils.java diff --git a/.classpath b/.classpath index 35bca5e..159aeee 100644 --- a/.classpath +++ b/.classpath @@ -1,18 +1,7 @@ - - - - - - - - - - - - - + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 8626026..d59e09c 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,5 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..e147f64 --- /dev/null +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/pom.xml b/pom.xml index 77538c2..b1364e4 100644 --- a/pom.xml +++ b/pom.xml @@ -1,8 +1,29 @@ - - 4.0.0 - inflexion - inflexion - 0.0.1-SNAPSHOT - Inflexion - Java based implementation of Damian Conway's pluralization algorithm. + + 4.0.0 + inflexion + inflexion + 0.0.1-SNAPSHOT + Inflexion + Java based implementation of Damian Conway's pluralization algorithm. + + + + + maven-compiler-plugin + + 1.8 + 1.8 + + + + + + data/ + + **/*.txt + + + + \ No newline at end of file diff --git a/src/main/java/bjc/inflexion/InflectionUtils.java b/src/main/java/bjc/inflexion/InflectionUtils.java new file mode 100644 index 0000000..6ea0ac3 --- /dev/null +++ b/src/main/java/bjc/inflexion/InflectionUtils.java @@ -0,0 +1,82 @@ +/** + * (C) Copyright 2017 Benjamin Culkin. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package bjc.inflexion; + +/** + * Utility functions for inflections. + * + * Whenever a suffix is mentioned, it should be provided in the format of a + * leading '-', followed by a regular expression. + * + * @author bjculkin + * + */ +public class InflectionUtils { + /** + * Returns true if the given word ends in the given suffix. + * + * @param word + * The word to check. + * + * @param suffix + * The suffix to check for. + * + * @return Whether or not the provided word ends in the provided suffix. + */ + public static boolean suffix(String word, String suffix) { + /* + * TODO implement me. + */ + return false; + } + + /** + * Check if the given word inflects from the given singular suffix to + * the given plural suffix. + * + * @param word + * The word to check. + * + * @param singular + * The singular suffix. + * + * @param plural + * The plural suffix. + * + * @return Whether or not the provided word is in that inflection + * category. + */ + public static boolean category(String word, String singular, String plural) { + /* + * TODO implement me. + */ + return false; + } + + /** + * + * @param word + * @param singular + * @param plural + * @return + */ + public static String inflect(String word, String singular, String plural) { + /* + * TODO implement me. + */ + return null; + } +} -- cgit v1.2.3