[FOray-commit] SF.net SVN: foray:[14945] trunk/foray/foray-orthograp hy/src
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2026-07-29 15:34:20
|
Revision: 14945
http://sourceforge.net/p/foray/code/14945
Author: victormote
Date: 2026-07-29 15:34:17 +0000 (Wed, 29 Jul 2026)
Log Message:
-----------
Add inflection classes for Early Modern English words regular verb forms ending in -eth.
Modified Paths:
--------------
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/eng/EngLatn.java
Added Paths:
-----------
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Factory.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/package-info.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_FactoryTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Tests.java
Added: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth.java (rev 0)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth.java 2026-07-29 15:34:17 UTC (rev 14945)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2026 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.orthography.inflection.emen;
+
+import org.foray.orthography.Word4a;
+import org.foray.orthography.WordSegment4a;
+import org.foray.orthography.inflection.InflectedWord;
+import org.foray.orthography.inflection.eng.EngLatn;
+
+import java.util.regex.Pattern;
+
+/**
+ * (For Early Modern English), wraps a regular verb, and adds "eth" to the end to make it present tense.
+ * For example, the English word "hold" would be wrapped to make the word "holdeth".
+ */
+public class EmenLatnSuffix_eth extends InflectedWord {
+
+ /** The pattern to be matched by words with this inflection. */
+ public static final Pattern PATTERN = Pattern.compile("^(" + EngLatn.WORD_CHARS + "+)eth$");
+
+ /** Constant needed for serialization. */
+ private static final long serialVersionUID = -2482073895198981184L;
+
+ /**
+ * Constructor.
+ * @param wrappedWord The wrapped word.
+ */
+ public EmenLatnSuffix_eth(final Word4a wrappedWord) {
+ super(wrappedWord);
+ }
+
+ @Override
+ public WordSegment4a getAppendedSegment() {
+ return EngLatn.ETH_SEGMENT;
+ }
+
+ @Override
+ public WordSegment4a getModifiedSegment() {
+ return null;
+ }
+
+}
Property changes on: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Factory.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Factory.java (rev 0)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Factory.java 2026-07-29 15:34:17 UTC (rev 14945)
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2026 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.orthography.inflection.emen;
+
+import org.foray.orthography.Word4a;
+import org.foray.orthography.inflection.InflectionFactory;
+
+import org.axsl.orthography.PartOfSpeech;
+import org.axsl.orthography.PosQualifier;
+
+import java.util.regex.Matcher;
+
+/**
+ * Factory class for {@link EmenLatnSuffix_eth}.
+ */
+public final class EmenLatnSuffix_eth_Factory extends InflectionFactory<EmenLatnSuffix_eth> {
+
+ /** The singleton instance. */
+ private static final EmenLatnSuffix_eth_Factory THE_INSTANCE = new EmenLatnSuffix_eth_Factory();
+
+ /**
+ * Private constructor for this singleton class.
+ */
+ private EmenLatnSuffix_eth_Factory() { }
+
+ /**
+ * Returns the singleton instance.
+ * @return The singleton instance.
+ */
+ public static EmenLatnSuffix_eth_Factory getInstance() {
+ return THE_INSTANCE;
+ }
+
+ @Override
+ public CharSequence findLemmaChars(final CharSequence chars) {
+ final Matcher matcher = EmenLatnSuffix_eth.PATTERN.matcher(chars);
+ if (! matcher.matches()) {
+ return null;
+ }
+
+ final String lemmaChars = matcher.group(1);
+ return lemmaChars;
+ }
+
+ @Override
+ public boolean isValidLemma(final Word4a lemma) {
+ if (lemma.isOfQualifiedType(PartOfSpeech.VERB, PosQualifier.REGULAR_ROOT)) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected EmenLatnSuffix_eth makeInstance(final Word4a lemma) {
+ return new EmenLatnSuffix_eth(lemma);
+ }
+
+}
Property changes on: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Factory.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/package-info.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/package-info.java (rev 0)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/package-info.java 2026-07-29 15:34:17 UTC (rev 14945)
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2026 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$
+ */
+
+/**
+ * <p>Classes English-language inflection classes.
+ * Classes in this package are subclasses of {@link org.foray.orthography.WordWrapper} or
+ * {@link org.foray.orthography.inflection.InflectionFactory}.</p>
+ */
+
+package org.foray.orthography.inflection.emen;
Property changes on: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/emen/package-info.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/eng/EngLatn.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/eng/EngLatn.java 2026-07-29 14:13:05 UTC (rev 14944)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/inflection/eng/EngLatn.java 2026-07-29 15:34:17 UTC (rev 14945)
@@ -56,6 +56,8 @@
/** Common word segment "ing" in English inflections. */
public static final StringWordSegmentUtf16 ING_SEGMENT = new StringWordSegmentUtf16("ing");
+ /** Common word segment "eth" in Early Modern English inflections. */
+ public static final StringWordSegmentUtf16 ETH_SEGMENT = new StringWordSegmentUtf16("eth");
/**
* Private constructor. This utility class should never be instantiated.
Added: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_FactoryTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_FactoryTests.java (rev 0)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_FactoryTests.java 2026-07-29 15:34:17 UTC (rev 14945)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2026 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.orthography.inflection.emen;
+
+import org.foray.orthography.Dictionary4a;
+import org.foray.orthography.StringWordTests;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import org.assertj.core.api.AssertionsForClassTypes;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+/**
+ * Tests of {@link EmenLatnSuffix_eth_Factory}.
+ */
+public class EmenLatnSuffix_eth_FactoryTests {
+
+ /** The object under test. */
+ private EmenLatnSuffix_eth_Factory out;
+
+ /** A dictionary to use for these tests. */
+ private Dictionary4a dictionary;
+
+ /**
+ * Test setup.
+ */
+ @BeforeEach
+ public void before() {
+ this.out = EmenLatnSuffix_eth_Factory.getInstance();
+ this.dictionary = Mockito.mock(Dictionary4a.class);
+ Mockito.when(dictionary.getWord("talk")).thenReturn(StringWordTests.WORD_TALK);
+ }
+
+ /**
+ * Test of a String for which the factory should not be able to create an instance.
+ */
+ @Test
+ public void testInvalid() {
+ AssertionsForClassTypes.assertThat(out.makeInstance("talking", this.dictionary)).isNull();
+ }
+
+ /**
+ * Test of a String for which the factory should be able to create an instance.
+ */
+ @Test
+ public void testValid() {
+ final EmenLatnSuffix_eth word = out.makeInstance("talketh", this.dictionary);
+ /* Test for instance equality. */
+ AssertionsForClassTypes.assertThat(word.getWrappedWord()).isEqualTo(StringWordTests.WORD_TALK);
+ assertThat(word.getActualContent().toString()).isEqualTo("talketh");
+ }
+
+}
Property changes on: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_FactoryTests.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Tests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Tests.java (rev 0)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Tests.java 2026-07-29 15:34:17 UTC (rev 14945)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2026 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.orthography.inflection.emen;
+
+import org.foray.orthography.StringWord;
+import org.foray.orthography.StringWordTests;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests of {@link EmenLatnSuffix_eth}.
+ */
+public class EmenLatnSuffix_eth_Tests {
+
+ /**
+ * Tests various aspects of words ending in -eth.
+ */
+ @Test
+ public void test01() {
+ final StringWord word = StringWordTests.WORD_TALK;
+ final EmenLatnSuffix_eth wrapper = new EmenLatnSuffix_eth(word);
+
+ assertThat(wrapper.toString()).isEqualTo("talk-eth");
+ assertThat(wrapper.getNormalizedContent()).isEqualTo("talk");
+ assertThat(wrapper.getActualContent().toString()).isEqualTo("talketh");
+ }
+
+}
Property changes on: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/inflection/emen/EmenLatnSuffix_eth_Tests.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|