[FOray-commit] SF.net SVN: foray:[14955] trunk/foray/foray-orthograp hy/src/main
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2026-07-31 09:57:34
|
Revision: 14955
http://sourceforge.net/p/foray/code/14955
Author: victormote
Date: 2026-07-31 09:57:31 +0000 (Fri, 31 Jul 2026)
Log Message:
-----------
Conform to aXSL change: Add word-choice element to group proper but conflicting spellings together.
Modified Paths:
--------------
trunk/foray/foray-orthography/src/main/data/dictionaries/eng-Latn-ZZZ.dict.xml
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/DictionaryParser.java
Modified: trunk/foray/foray-orthography/src/main/data/dictionaries/eng-Latn-ZZZ.dict.xml
===================================================================
--- trunk/foray/foray-orthography/src/main/data/dictionaries/eng-Latn-ZZZ.dict.xml 2026-07-30 17:23:12 UTC (rev 14954)
+++ trunk/foray/foray-orthography/src/main/data/dictionaries/eng-Latn-ZZZ.dict.xml 2026-07-31 09:57:31 UTC (rev 14955)
@@ -63599,8 +63599,10 @@
<w><t>Good-a-cre</t></w>
<phrase><t>good af-ter-noon</t></phrase>
<phrase><t>good ar-vo</t></phrase>
-<w><t>good-by</t></w>
-<w><t>good-bye</t></w>
+<word-choice>
+ <w><t>good-bye</t><noun><pluralizable/></noun><interjection/></w>
+ <w><t>good-by</t><noun><pluralizable/></noun><interjection/></w>
+</word-choice>
<phrase><t>good eve-ning</t></phrase>
<w><t>good=fel-low-ship</t></w>
<w><t>good=for=noth-ing</t></w>
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/DictionaryParser.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/DictionaryParser.java 2026-07-30 17:23:12 UTC (rev 14954)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/DictionaryParser.java 2026-07-31 09:57:31 UTC (rev 14955)
@@ -193,6 +193,9 @@
/** The system ID of the input source being parsed. */
private URL systemId;
+ /** The list of words inside a word-choice element. */
+ private List<StringWord> currentWordChoice;
+
/**
* Constructor.
* @param orthographyServer The orthography server.
@@ -362,6 +365,7 @@
StringUtils.EMPTY_STRING, attributes, "allow-duplicates", false);
this.lastWord = StringUtils.EMPTY_STRING;
+ this.currentWordChoice = null;
break;
}
case "import-standard-dictionary": {
@@ -463,6 +467,11 @@
this.unresolvedDuplicate = true;
break;
}
+ /* TODO: Store word-choice in a way that allows a selection to be enforced. */
+ case "word-choice": {
+ this.currentWordChoice = new ArrayList<StringWord>(2);
+ break;
+ }
default: {
throw new IllegalStateException("Unknown element started: " + localName + ", " +
getLocationString(getLocator()));
@@ -479,8 +488,13 @@
case "w": {
final StringWord word = new StringWord(this.posBuilder.value(), this.currentSegments);
final String actualContent = word.getActualContent().toString();
- checkCollation(actualContent, word.getCollatingContent().toString());
+ /* Within a word-choice, the words may be out of order, so we check only the first item. */
+ if (this.currentWordChoice == null
+ || this.currentWordChoice.size() < 1) {
+ checkCollation(actualContent, word.getCollatingContent().toString());
+ }
+
if (this.ambiguousWordComponents == null) {
/* Add it to normal words. */
if (this.currentDictionaryElement.wordMap.get(actualContent) == null) {
@@ -494,6 +508,9 @@
} else {
this.ambiguousWordComponents.add(word);
}
+ if (this.currentWordChoice != null) {
+ this.currentWordChoice.add(word);
+ }
break;
}
case "t": {
@@ -626,6 +643,10 @@
this.unresolvedDuplicate = false;
break;
}
+ case "word-choice": {
+ this.currentWordChoice = null;
+ break;
+ }
default: {
throw new IllegalStateException("Unknown element ended: " + localName);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|