[FOray-commit] SF.net SVN: foray:[12366] trunk/foray/foray-orthography/src
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-01-10 01:54:07
|
Revision: 12366
http://sourceforge.net/p/foray/code/12366
Author: victormote
Date: 2022-01-10 01:54:04 +0000 (Mon, 10 Jan 2022)
Log Message:
-----------
Conform to aXSL changes: Move remaining code related to line-breaking from axsl-orthography to axsl-fotree.
Modified Paths:
--------------
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutatingWord4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegment.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordWrapper.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/FinalSegmentModifiedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/SuffixedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -36,8 +36,10 @@
import org.axsl.common.para.ParaGlue;
import org.axsl.common.para.ParaLeaf;
import org.axsl.common.para.ParaPenalty;
+import org.axsl.fotree.text.FoDiscretionaryHyphen;
import org.axsl.orthography.DiscretionaryHyphen;
+import java.util.Collections;
import java.util.EnumMap;
import java.util.Map;
@@ -45,32 +47,44 @@
* FOray implementation of {@link DiscretionaryHyphen}.
* Instances of this class are immutable.
*/
-public final class DiscretionaryHyphen4a extends ParaLeaf4a implements DiscretionaryHyphen {
+public final class DiscretionaryHyphen4a extends ParaLeaf4a implements FoDiscretionaryHyphen {
- /** Pre-built "heinous" hyphenation point. */
- public static final DiscretionaryHyphen4a HEINOUS = new DiscretionaryHyphen4a(ParaPenalty.Quality.INFINITE_PENALTY);
-
/** Pre-built "acceptable" hyphenation point. */
- public static final DiscretionaryHyphen4a ACCEPTABLE = new DiscretionaryHyphen4a(ParaPenalty.Quality.ACCEPTABLE);
+ public static final DiscretionaryHyphen4a ACCEPTABLE =
+ new DiscretionaryHyphen4a(DiscretionaryHyphen.Quality.ACCEPTABLE);
/** Pre-built "good" hyphenation point. */
- public static final DiscretionaryHyphen4a GOOD = new DiscretionaryHyphen4a(ParaPenalty.Quality.GOOD);
+ public static final DiscretionaryHyphen4a GOOD = new DiscretionaryHyphen4a(DiscretionaryHyphen.Quality.GOOD);
/** Pre-built "best" hyphenation point. */
- public static final DiscretionaryHyphen4a BEST = new DiscretionaryHyphen4a(ParaPenalty.Quality.BEST);
+ public static final DiscretionaryHyphen4a BEST = new DiscretionaryHyphen4a(DiscretionaryHyphen.Quality.BEST);
- /** The array of pre-constructed instances. */
+ /** The map of pre-constructed instances. */
private static final Map<ParaPenalty.Quality, DiscretionaryHyphen4a> PRE_CONSTRUCTED_POINTS =
new EnumMap<ParaPenalty.Quality, DiscretionaryHyphen4a>(ParaPenalty.Quality.class);
static {
- PRE_CONSTRUCTED_POINTS.put(ParaPenalty.Quality.INFINITE_PENALTY, HEINOUS);
PRE_CONSTRUCTED_POINTS.put(ParaPenalty.Quality.ACCEPTABLE, ACCEPTABLE);
PRE_CONSTRUCTED_POINTS.put(ParaPenalty.Quality.GOOD, GOOD);
PRE_CONSTRUCTED_POINTS.put(ParaPenalty.Quality.BEST, BEST);
}
+ /** Map whose key is an instance of {@link DiscretionaryHyphen.Quality} and whose value is the instance of
+ * {@link ParaPenalty.Quality} to which it maps. */
+ private static final Map<DiscretionaryHyphen.Quality, ParaPenalty.Quality> PENALTY_MAP_INTERNAL =
+ new EnumMap<DiscretionaryHyphen.Quality, ParaPenalty.Quality>(DiscretionaryHyphen.Quality.class);
+ static {
+ PENALTY_MAP_INTERNAL.put(DiscretionaryHyphen.Quality.ACCEPTABLE, ParaPenalty.Quality.ACCEPTABLE);
+ PENALTY_MAP_INTERNAL.put(DiscretionaryHyphen.Quality.GOOD, ParaPenalty.Quality.GOOD);
+ PENALTY_MAP_INTERNAL.put(DiscretionaryHyphen.Quality.BEST, ParaPenalty.Quality.BEST);
+ }
+
+ /** Unmodifiable view of the map whose key is an instance of {@link DiscretionaryHyphen.Quality} and whose value is
+ * the instance of {@link ParaPenalty.Quality} to which it maps. */
+ public static final Map<DiscretionaryHyphen.Quality, ParaPenalty.Quality> PENALTY_MAP =
+ Collections.unmodifiableMap(PENALTY_MAP_INTERNAL);
+
/** The quality for this instance. */
- private ParaPenalty.Quality quality;
+ private DiscretionaryHyphen.Quality quality;
/**
* Protected constructor. There are only 3 possible normal values, so these are pre-constructed.
@@ -77,7 +91,7 @@
* Use {@link #fromQuality(org.axsl.common.para.ParaPenalty.Quality)} to obtain an instance of this class.
* @param quality The quality for this instance.
*/
- protected DiscretionaryHyphen4a(final ParaPenalty.Quality quality) {
+ protected DiscretionaryHyphen4a(final DiscretionaryHyphen.Quality quality) {
this.quality = quality;
}
@@ -91,7 +105,7 @@
}
@Override
- public ParaPenalty.Quality getQuality() {
+ public DiscretionaryHyphen.Quality getQuality() {
return this.quality;
}
@@ -106,8 +120,13 @@
}
@Override
+ public org.axsl.common.para.ParaPenalty.Quality getPenaltyQuality() {
+ return PENALTY_MAP.get(this.quality);
+ }
+
+ @Override
public int getCost(final ParaContext paraContext) {
- return paraContext.getCost(this.quality);
+ return paraContext.getCost(getPenaltyQuality());
}
@Override
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -44,13 +44,14 @@
import org.axsl.common.para.ParaLeaf;
import org.axsl.common.para.ParaNode;
import org.axsl.common.para.ParaPenalty;
+import org.axsl.fotree.text.FoDiscretionaryHyphen;
+import org.axsl.orthography.DiscretionaryHyphen;
import org.axsl.orthography.DiscretionaryHyphenMutating;
import java.io.Serializable;
/**
- * <p>Specialized information about a specific hyphenation break opportunity in
- * a word.
+ * <p>Specialized information about a specific hyphenation break opportunity in a word.
* This handles "hard" hyphenation cases, such as those where the word changes
* spelling when it is hyphenated.
* See {@link org.axsl.orthography.DiscretionaryHyphenMutating} for more information about the
@@ -62,13 +63,13 @@
* pre-break and post-break are used. Typically, pre-break is equal to
* the hyphen character and the others are empty.</p>
*/
-public class DiscretionaryHyphenMutating4a implements Serializable, DiscretionaryHyphenMutating {
+public class DiscretionaryHyphenMutating4a implements Serializable, FoDiscretionaryHyphen, DiscretionaryHyphenMutating {
/** Constant needed for serialization. */
private static final long serialVersionUID = 990405609314441965L;
/** The quality for this instance. */
- private ParaPenalty.Quality quality;
+ private DiscretionaryHyphen.Quality quality;
/** The pre-break text. */
private String preBreak;
@@ -86,7 +87,7 @@
* @param no The no-break text (can be null).
* @param post The post-break text (can be null).
*/
- DiscretionaryHyphenMutating4a(final ParaPenalty.Quality quality, final String pre, final String no,
+ DiscretionaryHyphenMutating4a(final DiscretionaryHyphen.Quality quality, final String pre, final String no,
final String post) {
this.quality = quality;
this.preBreak = pre;
@@ -145,7 +146,7 @@
}
@Override
- public Quality getQuality() {
+ public DiscretionaryHyphen.Quality getQuality() {
return this.quality;
}
@@ -156,10 +157,16 @@
}
@Override
+ public org.axsl.common.para.ParaPenalty.Quality getPenaltyQuality() {
+ return DiscretionaryHyphen4a.PENALTY_MAP.get(this.quality);
+ }
+
+ @Override
public int getCost(final ParaContext paraContext) {
- return paraContext.getCost(this.quality);
+ return paraContext.getCost(getPenaltyQuality());
}
+
@Override
public boolean isFlagged() {
return true;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutatingWord4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutatingWord4a.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutatingWord4a.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -28,7 +28,7 @@
package org.foray.orthography;
-import org.axsl.orthography.DiscretionaryHyphen;
+import org.axsl.fotree.text.FoDiscretionaryHyphen;
import java.io.Serializable;
@@ -75,7 +75,7 @@
}
@Override
- public DiscretionaryHyphen hyphenationPointAt(final int pointIndex) {
+ public FoDiscretionaryHyphen hyphenationPointAt(final int pointIndex) {
if (this.breaks[pointIndex] == null) {
return super.hyphenationPointAt(pointIndex);
} else {
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -28,8 +28,9 @@
package org.foray.orthography;
+import org.axsl.fotree.text.FoWordComponent;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.Word;
-import org.axsl.orthography.WordComponent;
import org.axsl.orthography.WordSegment;
/**
@@ -93,7 +94,7 @@
}
@Override
- public WordSegment wordSegmentAt(final int segmentIndex) {
+ public FoWordSegment wordSegmentAt(final int segmentIndex) {
final int dictionaryIndex = this.segments[segmentIndex];
return this.dictionary.getWordSegment(dictionaryIndex);
}
@@ -114,7 +115,7 @@
}
@Override
- public WordComponent paraLeafAt(final int index) {
+ public FoWordComponent paraLeafAt(final int index) {
return wordComponentAt(index);
}
@@ -134,7 +135,7 @@
public CharSequence getText() {
final StringBuilder builder = new StringBuilder();
for (int index = 0; index < this.segments.length; index ++) {
- final WordSegment segment = wordSegmentAt(index);
+ final FoWordSegment segment = wordSegmentAt(index);
builder.append(segment.getText());
}
return builder.toString();
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegment.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegment.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWordSegment.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -28,8 +28,7 @@
package org.foray.orthography;
-import org.axsl.common.para.ParaLeaf;
-import org.axsl.orthography.WordSegment;
+import org.axsl.fotree.text.FoWordSegment;
/**
* Word segments made up of string or string-like entities.
@@ -36,6 +35,6 @@
* This interface is needed for classes that extend classes that are raw in nature and that would not be expected to
* conform to this kind of interface.
*/
-public interface StringWordSegment extends WordSegment, ParaLeaf {
+public interface StringWordSegment extends FoWordSegment {
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -36,10 +36,11 @@
import org.axsl.common.para.ParaNode;
import org.axsl.common.para.ParaPenalty;
import org.axsl.common.sequence.ByteSequence;
+import org.axsl.fotree.text.FoDiscretionaryHyphen;
import org.axsl.fotree.text.FoWord;
-import org.axsl.orthography.DiscretionaryHyphen;
+import org.axsl.fotree.text.FoWordComponent;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.Word;
-import org.axsl.orthography.WordComponent;
import org.axsl.orthography.WordSegment;
import java.io.Serializable;
@@ -63,7 +64,7 @@
public String toString() {
final StringBuilder builder = new StringBuilder();
for (int index = 0; index < qtyWordComponents(); index ++) {
- final ParaLeaf component = wordComponentAt(index);
+ final FoWordComponent component = wordComponentAt(index);
builder.append(component.toString());
}
return builder.toString();
@@ -73,7 +74,7 @@
public CharSequence getActualContent() {
final StringBuilder builder = new StringBuilder();
for (int index = 0; index < qtyWordSegments(); index ++) {
- final WordSegment segment = wordSegmentAt(index);
+ final FoWordSegment segment = wordSegmentAt(index);
builder.append(segment.getText());
}
return builder.toString();
@@ -83,7 +84,7 @@
public CharSequence getNormalizedContent() {
final StringBuilder builder = new StringBuilder();
for (int index = 0; index < qtyWordSegments(); index ++) {
- final WordSegment segment = wordSegmentAt(index);
+ final FoWordSegment segment = wordSegmentAt(index);
builder.append(segment.getText());
}
return builder.toString();
@@ -164,7 +165,7 @@
}
@Override
- public DiscretionaryHyphen hyphenationPointAt(final int pointIndex) {
+ public FoDiscretionaryHyphen hyphenationPointAt(final int pointIndex) {
return DiscretionaryHyphen4a.fromQuality(ParaPenalty.Quality.ACCEPTABLE);
}
@@ -181,7 +182,7 @@
}
@Override
- public WordComponent wordComponentAt(final int componentIndex) {
+ public FoWordComponent wordComponentAt(final int componentIndex) {
if (componentIndex < 0
|| componentIndex >= qtyWordComponents()) {
throw new IndexOutOfBoundsException(Integer.toString(componentIndex));
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -35,6 +35,7 @@
import org.axsl.common.para.ParaGlue;
import org.axsl.common.para.ParaLeaf;
import org.axsl.common.para.ParaPenalty;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.WordSegment;
import java.io.Serializable;
@@ -42,7 +43,7 @@
/**
* Abstract superclass for FOray {@link WordSegment} implementations.
*/
-public abstract class WordSegment4a extends ParaLeaf4a implements WordSegment, Serializable {
+public abstract class WordSegment4a extends ParaLeaf4a implements FoWordSegment, Serializable {
/** Constant needed for serialization. */
private static final long serialVersionUID = -9006099460669286001L;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordWrapper.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordWrapper.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordWrapper.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -29,7 +29,7 @@
package org.foray.orthography;
import org.axsl.fotree.text.FoWord;
-import org.axsl.orthography.WordSegment;
+import org.axsl.fotree.text.FoWordSegment;
/**
* Decorates a normalized word with some additional data.
@@ -70,7 +70,7 @@
}
@Override
- public WordSegment wordSegmentAt(final int segmentIndex) {
+ public FoWordSegment wordSegmentAt(final int segmentIndex) {
return this.wrappedWord.wordSegmentAt(segmentIndex);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/CapitalizedWord.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -32,6 +32,7 @@
import org.axsl.common.para.ParaLeaf;
import org.axsl.fotree.text.FoWord;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.WordSegment;
/**
@@ -91,8 +92,8 @@
}
@Override
- public WordSegment wordSegmentAt(final int segmentIndex) {
- final WordSegment segment = getWrappedWord().wordSegmentAt(segmentIndex);
+ public FoWordSegment wordSegmentAt(final int segmentIndex) {
+ final FoWordSegment segment = getWrappedWord().wordSegmentAt(segmentIndex);
if (segmentIndex == 0) {
return new Segment(segment);
} else {
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -35,7 +35,7 @@
import org.axsl.common.para.ParaNode;
import org.axsl.common.para.ParaPenalty;
import org.axsl.fotree.text.FoWord;
-import org.axsl.orthography.WordComponent;
+import org.axsl.fotree.text.FoWordComponent;
/**
* Decorates a normalized word with some additional data.
@@ -89,7 +89,7 @@
}
@Override
- public WordComponent wordComponentAt(final int componentIndex) {
+ public FoWordComponent wordComponentAt(final int componentIndex) {
if (componentIndex < 0
|| componentIndex >= qtyWordComponents()) {
throw new IndexOutOfBoundsException(Integer.toString(componentIndex));
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/ExactWord.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -34,7 +34,7 @@
import org.axsl.common.para.ParaLeaf;
import org.axsl.fotree.text.FoWord;
-import org.axsl.orthography.WordSegment;
+import org.axsl.fotree.text.FoWordSegment;
/**
* Decorates a normalized word with an exact representation of the actual capitalization.
@@ -69,8 +69,8 @@
}
@Override
- public WordSegment wordSegmentAt(final int segmentIndex) {
- final WordSegment segment = getWrappedWord().wordSegmentAt(segmentIndex);
+ public FoWordSegment wordSegmentAt(final int segmentIndex) {
+ final FoWordSegment segment = getWrappedWord().wordSegmentAt(segmentIndex);
final int start = StringWord.getSegmentStart(getWrappedWord(), segmentIndex);
if (CharSequenceUtils.areEquivalent(segment, 0, segment.length(), this.exact, 0, this.exact.length())) {
return segment;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/FinalSegmentModifiedWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/FinalSegmentModifiedWord.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/FinalSegmentModifiedWord.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -31,6 +31,7 @@
import org.foray.orthography.WordWrapper;
import org.axsl.fotree.text.FoWord;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.WordSegment;
/**
@@ -42,7 +43,7 @@
private static final long serialVersionUID = 8075477767144178967L;
/** The word segment that replaces the last word segment in the wrapped word. */
- private WordSegment lastSegment;
+ private FoWordSegment lastSegment;
/**
* Package-visible constructor. Use {@link LatinPlural1WordFactory} to create an instance.
@@ -56,7 +57,7 @@
}
@Override
- public WordSegment wordSegmentAt(final int segmentIndex) {
+ public FoWordSegment wordSegmentAt(final int segmentIndex) {
if (segmentIndex == qtyWordSegments() - 1) {
return this.lastSegment;
}
@@ -68,6 +69,6 @@
* @param unmodifiedSegment The segment that should be wrapped to create the substitute.
* @return The segment that replaces the final segment.
*/
- protected abstract WordSegment createModifiedSegment(WordSegment unmodifiedSegment);
+ protected abstract FoWordSegment createModifiedSegment(WordSegment unmodifiedSegment);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural1Word.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -30,6 +30,7 @@
import org.axsl.common.para.ParaLeaf;
import org.axsl.fotree.text.FoWord;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.WordSegment;
/**
@@ -86,7 +87,7 @@
}
@Override
- protected WordSegment createModifiedSegment(final WordSegment unmodifiedSegment) {
+ protected FoWordSegment createModifiedSegment(final WordSegment unmodifiedSegment) {
return new Segment(unmodifiedSegment);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPlural2Word.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -30,6 +30,7 @@
import org.axsl.common.para.ParaLeaf;
import org.axsl.fotree.text.FoWord;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.WordSegment;
/**
@@ -89,7 +90,7 @@
}
@Override
- protected WordSegment createModifiedSegment(final WordSegment unmodifiedSegment) {
+ protected FoWordSegment createModifiedSegment(final WordSegment unmodifiedSegment) {
return new Segment(unmodifiedSegment);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive1Word.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -30,6 +30,7 @@
import org.axsl.common.para.ParaLeaf;
import org.axsl.fotree.text.FoWord;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.WordSegment;
/**
@@ -87,7 +88,7 @@
}
@Override
- protected WordSegment createModifiedSegment(final WordSegment unmodifiedSegment) {
+ protected FoWordSegment createModifiedSegment(final WordSegment unmodifiedSegment) {
return new Segment(unmodifiedSegment);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/LatinPossessive2Word.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -30,6 +30,7 @@
import org.axsl.common.para.ParaLeaf;
import org.axsl.fotree.text.FoWord;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.WordSegment;
/**
@@ -87,7 +88,7 @@
}
@Override
- protected WordSegment createModifiedSegment(final WordSegment unmodifiedSegment) {
+ protected FoWordSegment createModifiedSegment(final WordSegment unmodifiedSegment) {
return new Segment(unmodifiedSegment);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/SuffixedWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/SuffixedWord.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/SuffixedWord.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -32,7 +32,7 @@
import org.foray.orthography.WordWrapper;
import org.axsl.fotree.text.FoWord;
-import org.axsl.orthography.WordSegment;
+import org.axsl.fotree.text.FoWordSegment;
/**
* Wraps a word that has a suffix attached.
@@ -57,7 +57,7 @@
}
@Override
- public WordSegment wordSegmentAt(final int segmentIndex) {
+ public FoWordSegment wordSegmentAt(final int segmentIndex) {
if (segmentIndex < getWrappedWord().qtyWordSegments()) {
return getWrappedWord().wordSegmentAt(segmentIndex);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/UppercaseWord.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -32,6 +32,7 @@
import org.axsl.common.para.ParaLeaf;
import org.axsl.fotree.text.FoWord;
+import org.axsl.fotree.text.FoWordSegment;
import org.axsl.orthography.WordSegment;
/**
@@ -86,7 +87,7 @@
}
@Override
- public WordSegment wordSegmentAt(final int segmentIndex) {
+ public FoWordSegment wordSegmentAt(final int segmentIndex) {
final WordSegment segment = getWrappedWord().wordSegmentAt(segmentIndex);
return new Segment(segment);
}
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -29,7 +29,7 @@
package org.foray.orthography;
import org.axsl.common.para.ParaNode;
-import org.axsl.common.para.ParaPenalty.Quality;
+import org.axsl.orthography.DiscretionaryHyphen.Quality;
import org.junit.Assert;
import org.junit.BeforeClass;
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-01-10 00:20:06 UTC (rev 12365)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-01-10 01:54:04 UTC (rev 12366)
@@ -29,7 +29,7 @@
package org.foray.orthography;
import org.axsl.common.para.ParaNode;
-import org.axsl.common.para.ParaPenalty.Quality;
+import org.axsl.orthography.DiscretionaryHyphen.Quality;
import org.axsl.orthography.Word;
import org.junit.Assert;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|