Revision: 11998
http://sourceforge.net/p/foray/code/11998
Author: victormote
Date: 2021-11-05 14:50:02 +0000 (Fri, 05 Nov 2021)
Log Message:
-----------
Move DerivativeType from FOray to aXSL, as it is now used in aXSL DTD.
Modified Paths:
--------------
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/ConfigParser.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DerivativeRule.java
Removed Paths:
-------------
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DerivativeType.java
Modified: trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/ConfigParser.java
===================================================================
--- trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/ConfigParser.java 2021-11-05 14:17:49 UTC (rev 11997)
+++ trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/ConfigParser.java 2021-11-05 14:50:02 UTC (rev 11998)
@@ -38,6 +38,7 @@
import org.foray.common.resource.ResourceLocationClasspath;
import org.foray.common.resource.ResourceLocationUrl;
+import org.axsl.hyphen.DerivativeType;
import org.axsl.hyphen.HyphenationException;
import org.axsl.hyphen.PartOfSpeech;
Modified: trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DerivativeRule.java
===================================================================
--- trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DerivativeRule.java 2021-11-05 14:17:49 UTC (rev 11997)
+++ trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DerivativeRule.java 2021-11-05 14:50:02 UTC (rev 11998)
@@ -28,6 +28,7 @@
package org.foray.hyphen;
+import org.axsl.hyphen.DerivativeType;
import org.axsl.hyphen.PartOfSpeech;
import org.axsl.hyphen.PosRegularity;
import org.axsl.hyphen.Word;
Deleted: trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DerivativeType.java
===================================================================
--- trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DerivativeType.java 2021-11-05 14:17:49 UTC (rev 11997)
+++ trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DerivativeType.java 2021-11-05 14:50:02 UTC (rev 11998)
@@ -1,110 +0,0 @@
-/*
- * Copyright 2021 The FOray Project.
- * http://www.foray.org
- *
- * 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.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.hyphen;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Types of derivatives, a derivative being a word that is formed from another.
- * In English, this is often done by adding a suffix to the root.
- */
-public enum DerivativeType {
-
- /** The derivative is a plural of the root. English examples: "road(s)" derived from "road", "lunch(es)" derived
- * from "lunch", "part(ies)" derived from "part(y)". */
- PLURAL("plural"),
-
- /** The derivative is a possessive form of the root. English examples: "teacher(’s)" derived from "teacher",
- * "company(’s)" derived from "company". */
- POSSESSIVE("possessive"),
-
- /** The derivative is a different verb form of the root, which should also be a verb. English examples:
- * "empt(ies)" derived from "empt(y)", a change to the 3rd person singular form. */
- VERB_FORM("verb-form"),
-
- /** The derivative is a past participle. English examples: "finish(ed)" derived from "finish". */
- PAST_PARTICIPLE("past-participle"),
-
- /** The derivative is a present participle. English examples: "finish(ing)" derived from "finish". */
- PRESENT_PARTICIPLE("present-participle"),
-
- /** The derivative is a future participle. This is not used much in English, but is in some other languages, such
- * as Latin. */
- FUTURE_PARTICIPLE("future-participle"),
-
- /** The derivative is a gerund, a noun whose root is a verb. English example: "speaking well is an art" where the
- * "speaking" (noun) derived from "speak" (verb). */
- GERUND("gerund"),
-
- /** The derivative is a comparative, an adjective derived from another adjective. English examples: "great(er)"
- * derived from "great", "happ(ier)" derived from "happy". */
- COMPARATIVE("comparative"),
-
- /** The derivative is a superlative, an adjective derived from another adjective. English examples: "great(est)"
- * derived from "great", "happ(iest)" derived from "happy". */
- SUPERLATIVE("superlative");
-
- /** View of the underlying array that prevents it from being copied each time access is needed. */
- private static final List<DerivativeType> AS_LIST = Arrays.asList(DerivativeType.values());
-
- /** A descriptor suitable for use in configuration files. */
- private String token;
-
- /**
- * Constructor.
- * @param token A descriptor suitable for use in configuration files.
- */
- DerivativeType(final String token) {
- this.token = token;
- }
-
- /**
- * Returns a descriptor suitable for use in configuration files.
- * @return A descriptor suitable for use in configuration files.
- */
- public String getToken() {
- return this.token;
- }
-
- /**
- * Finds the instance of this enum, if any, matching {@code token}.
- * @param token The token for the instance of this enum that is wanted.
- * @return The instance of this enum matching {@code token}, or null if not found.
- */
- public static DerivativeType fromToken(final String token) {
- for (int index = 0; index < AS_LIST.size(); index ++) {
- final DerivativeType type = AS_LIST.get(index);
- if (type.token.equals(token)) {
- return type;
- }
- }
- return null;
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|