diff options
| author | bjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu> | 2017-04-05 10:06:24 -0400 |
|---|---|---|
| committer | bjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu> | 2017-04-05 10:06:24 -0400 |
| commit | 463e4e702bcdc312f5a081c85c7b00bbc0122265 (patch) | |
| tree | 817ad9c4aaf0516f712a8111169d5f6fd9f134c1 | |
| parent | 8259732a0e1d70284adcc6e7ef492603a3d59565 (diff) | |
Reorganize
| -rw-r--r-- | pom.xml | 4 | ||||
| -rw-r--r-- | src/examples/java/bjc/inflexion/examples/InflexionTester.java (renamed from src/examples/java/bjc/inflexion/InflexionTester.java) | 10 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/CategoricalNounInflection.java (renamed from src/main/java/bjc/inflexion/v2/CategoricalNounInflection.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/CompoundNounInflection.java (renamed from src/main/java/bjc/inflexion/v2/CompoundNounInflection.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/DefaultNounInflection.java (renamed from src/main/java/bjc/inflexion/v2/DefaultNounInflection.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/InflectionAffix.java (renamed from src/main/java/bjc/inflexion/v2/InflectionAffix.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/InflectionAffixes.java (renamed from src/main/java/bjc/inflexion/v2/InflectionAffixes.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/InflectionData.java | 86 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/InflectionException.java (renamed from src/main/java/bjc/inflexion/v2/InflectionException.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/InflectionUtils.java | 48 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/IrregularNounInflection.java (renamed from src/main/java/bjc/inflexion/v2/IrregularNounInflection.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/Noun.java (renamed from src/main/java/bjc/inflexion/v2/Noun.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/NounInflection.java (renamed from src/main/java/bjc/inflexion/v2/NounInflection.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/NounInflector.java | 36 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/Nouns.java (renamed from src/main/java/bjc/inflexion/v2/Nouns.java) | 6 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/Prepositions.java (renamed from src/main/java/bjc/inflexion/v2/Prepositions.java) | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/inflexion/SimpleInflectionAffix.java (renamed from src/main/java/bjc/inflexion/v2/SimpleInflectionAffix.java) | 2 |
17 files changed, 21 insertions, 191 deletions
@@ -7,7 +7,7 @@ <name>Inflexion</name> <description>Java based implementation of Damian Conway's Lingua::EN::Inflexion module for perl</description> <properties> - <main.class>bjc.dicelang.DiceLangConsole</main.class> + <main.class>bjc.inflexion.examples.InflexionTester</main.class> </properties> <licenses> <license> @@ -19,7 +19,7 @@ <scm> <connection>scm:git:https://github.com/bculkin2442/Inflexion.git</connection> - <url>https://github.com/atteo/Inflexion</url> + <url>https://github.com/bculkin2442/Inflexion</url> </scm> <build> diff --git a/src/examples/java/bjc/inflexion/InflexionTester.java b/src/examples/java/bjc/inflexion/examples/InflexionTester.java index 4123378..a54040d 100644 --- a/src/examples/java/bjc/inflexion/InflexionTester.java +++ b/src/examples/java/bjc/inflexion/examples/InflexionTester.java @@ -13,11 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion; - -import bjc.inflexion.v2.Noun; -import bjc.inflexion.v2.Nouns; -import bjc.inflexion.v2.Prepositions; +package bjc.inflexion.examples; import java.io.BufferedReader; import java.io.FileInputStream; @@ -33,6 +29,10 @@ import java.util.regex.Pattern; import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; +import bjc.inflexion.Noun; +import bjc.inflexion.Nouns; +import bjc.inflexion.Prepositions; + /** * Test inflecting words. * diff --git a/src/main/java/bjc/inflexion/v2/CategoricalNounInflection.java b/src/main/java/bjc/inflexion/CategoricalNounInflection.java index 5cddc5e..a57a2e2 100644 --- a/src/main/java/bjc/inflexion/v2/CategoricalNounInflection.java +++ b/src/main/java/bjc/inflexion/CategoricalNounInflection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; /** * Implementation of {@link NounInflection} for nouns matched by a regular diff --git a/src/main/java/bjc/inflexion/v2/CompoundNounInflection.java b/src/main/java/bjc/inflexion/CompoundNounInflection.java index afed0f8..85229f0 100644 --- a/src/main/java/bjc/inflexion/v2/CompoundNounInflection.java +++ b/src/main/java/bjc/inflexion/CompoundNounInflection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/main/java/bjc/inflexion/v2/DefaultNounInflection.java b/src/main/java/bjc/inflexion/DefaultNounInflection.java index 7c5a467..0d7be52 100644 --- a/src/main/java/bjc/inflexion/v2/DefaultNounInflection.java +++ b/src/main/java/bjc/inflexion/DefaultNounInflection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; /** * Default noun inflection for english nouns. diff --git a/src/main/java/bjc/inflexion/v2/InflectionAffix.java b/src/main/java/bjc/inflexion/InflectionAffix.java index a9c583d..f61ea79 100644 --- a/src/main/java/bjc/inflexion/v2/InflectionAffix.java +++ b/src/main/java/bjc/inflexion/InflectionAffix.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; /** * An affix attached to a word and used for inflection. diff --git a/src/main/java/bjc/inflexion/v2/InflectionAffixes.java b/src/main/java/bjc/inflexion/InflectionAffixes.java index 6ff86b7..dad5c9e 100644 --- a/src/main/java/bjc/inflexion/v2/InflectionAffixes.java +++ b/src/main/java/bjc/inflexion/InflectionAffixes.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; import java.util.regex.Pattern; diff --git a/src/main/java/bjc/inflexion/InflectionData.java b/src/main/java/bjc/inflexion/InflectionData.java deleted file mode 100644 index bf5f02c..0000000 --- a/src/main/java/bjc/inflexion/InflectionData.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * (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; - -/** - * Necessary data for inflection of various things. - * - * @author EVE - * - */ -public class InflectionData { - /** - * Check whether a word is a pronoun or not. - * - * @param word - * The possible pronoun. - * - * @return Whether or not the word is a pronoun. - */ - public static boolean isPronoun(String word) { - /* - * TODO implement me. - */ - return false; - } - - /** - * Get the plural form of the specified pronoun. - * - * @param pronoun - * The pronoun to pluralize. - * - * @return The plural form of the pronoun. - */ - public static String pluralPronoun(String pronoun) { - /* - * TODO implement me. - */ - return null; - } - - /** - * Check if the specified noun has an irregular plural. - * - * @param noun - * The noun to check for irregular plurals. - * - * @return The irregular plural for the noun. - */ - public static boolean nounHasIrregularPlural(String noun) { - /* - * TODO implement me. - */ - return false; - } - - /** - * Get the irregular plural for the specified noun. - * - * @param noun - * The noun to retrieve the irregular plural for. - * - * @return The irregular plural for the noun. - */ - public static String nounIrregularPlural(String noun) { - /* - * TODO implement me. - */ - return null; - } - - -}
\ No newline at end of file diff --git a/src/main/java/bjc/inflexion/v2/InflectionException.java b/src/main/java/bjc/inflexion/InflectionException.java index 5974018..5da518c 100644 --- a/src/main/java/bjc/inflexion/v2/InflectionException.java +++ b/src/main/java/bjc/inflexion/InflectionException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; /** * Exception thrown when something goes wrong with inflection. diff --git a/src/main/java/bjc/inflexion/InflectionUtils.java b/src/main/java/bjc/inflexion/InflectionUtils.java deleted file mode 100644 index fd9a9df..0000000 --- a/src/main/java/bjc/inflexion/InflectionUtils.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * (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; - -/** - * @author EVE - * - */ -public class InflectionUtils { - /** - * Inflect a word, replacing the singular suffix with the plural suffix. - * - * @param word - * The word to inflect. - * - * @param singular - * The singular prefix for the word. - * - * @param plural - * The plural prefix for the word. - * - * @return The word, with the singular prefix replaced with the plural - * prefix. - */ - public static String inflect(String word, String singular, String plural) { - /* - * Remove leading '-' from the patterns. - */ - return replaceLast(word, singular.substring(1), plural.substring(1)); - } - - private static String replaceLast(String text, String regex, String replacement) { - return text.replaceFirst("(?s)(.*)" + regex, "$1" + replacement); - } -} diff --git a/src/main/java/bjc/inflexion/v2/IrregularNounInflection.java b/src/main/java/bjc/inflexion/IrregularNounInflection.java index 294c6a3..6447db8 100644 --- a/src/main/java/bjc/inflexion/v2/IrregularNounInflection.java +++ b/src/main/java/bjc/inflexion/IrregularNounInflection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; /** * Implementation of {@link NounInflection} for irregular nouns. diff --git a/src/main/java/bjc/inflexion/v2/Noun.java b/src/main/java/bjc/inflexion/Noun.java index bf74613..25e4698 100644 --- a/src/main/java/bjc/inflexion/v2/Noun.java +++ b/src/main/java/bjc/inflexion/Noun.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; /** * A noun attached to an inflection. diff --git a/src/main/java/bjc/inflexion/v2/NounInflection.java b/src/main/java/bjc/inflexion/NounInflection.java index 2a4049f..f34b80c 100644 --- a/src/main/java/bjc/inflexion/v2/NounInflection.java +++ b/src/main/java/bjc/inflexion/NounInflection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; /** * Interface for inflecting nouns. diff --git a/src/main/java/bjc/inflexion/NounInflector.java b/src/main/java/bjc/inflexion/NounInflector.java deleted file mode 100644 index 5ba39fb..0000000 --- a/src/main/java/bjc/inflexion/NounInflector.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * (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; - -/** - * Inflect singular nouns to plural nouns. - * - * @author EVE - * - */ -public class NounInflector { - /** - * Inflect a singular noun to a plural form. - * - * @param noun - * The singular noun. - * - * @return The plural form of the noun. - */ - public static String inflectNoun(String noun) { - return null; - } -} diff --git a/src/main/java/bjc/inflexion/v2/Nouns.java b/src/main/java/bjc/inflexion/Nouns.java index e2609be..2fe4381 100644 --- a/src/main/java/bjc/inflexion/v2/Nouns.java +++ b/src/main/java/bjc/inflexion/Nouns.java @@ -13,7 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; + +import static bjc.inflexion.InflectionAffixes.*; import java.io.InputStream; import java.util.ArrayList; @@ -24,8 +26,6 @@ import java.util.Map; import java.util.Scanner; import java.util.regex.Pattern; -import static bjc.inflexion.v2.InflectionAffixes.*; - /** * @author EVE * diff --git a/src/main/java/bjc/inflexion/v2/Prepositions.java b/src/main/java/bjc/inflexion/Prepositions.java index 042ab8a..18767d0 100644 --- a/src/main/java/bjc/inflexion/v2/Prepositions.java +++ b/src/main/java/bjc/inflexion/Prepositions.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; import java.io.InputStream; import java.util.HashSet; diff --git a/src/main/java/bjc/inflexion/v2/SimpleInflectionAffix.java b/src/main/java/bjc/inflexion/SimpleInflectionAffix.java index 623c93c..10376f9 100644 --- a/src/main/java/bjc/inflexion/v2/SimpleInflectionAffix.java +++ b/src/main/java/bjc/inflexion/SimpleInflectionAffix.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package bjc.inflexion.v2; +package bjc.inflexion; import java.util.regex.Matcher; import java.util.regex.Pattern; |
