[FOray-commit] SF.net SVN: foray:[12061] trunk/foray/foray-orthography/src/main
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2021-11-14 19:46:20
|
Revision: 12061
http://sourceforge.net/p/foray/code/12061
Author: victormote
Date: 2021-11-14 19:46:18 +0000 (Sun, 14 Nov 2021)
Log Message:
-----------
Allow Punctuation4a to silently return a null. Fix some minor side-effects of that.
Modified Paths:
--------------
trunk/foray/foray-orthography/src/main/data/dictionaries/eng-999-Latn.dict.xml
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerLatin1.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
Modified: trunk/foray/foray-orthography/src/main/data/dictionaries/eng-999-Latn.dict.xml
===================================================================
--- trunk/foray/foray-orthography/src/main/data/dictionaries/eng-999-Latn.dict.xml 2021-11-14 16:56:39 UTC (rev 12060)
+++ trunk/foray/foray-orthography/src/main/data/dictionaries/eng-999-Latn.dict.xml 2021-11-14 19:46:18 UTC (rev 12061)
@@ -53,6 +53,7 @@
# web site, or submit a patch request.
-->
+<w><t>&</t></w>
<w><t>a</t></w>
<phrase><t>a cap-pel-la</t></phrase>
<phrase><t>a for-ti-o-ri</t></phrase>
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerLatin1.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerLatin1.java 2021-11-14 16:56:39 UTC (rev 12060)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerLatin1.java 2021-11-14 19:46:18 UTC (rev 12061)
@@ -39,6 +39,7 @@
public CharType isWordChar(final char c) {
switch (c) {
case '-': return CharType.ALWAYS_WORD_CHAR;
+ case '&': return CharType.ALWAYS_WORD_CHAR;
default: return super.isWordChar(c);
}
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2021-11-14 16:56:39 UTC (rev 12060)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2021-11-14 19:46:18 UTC (rev 12061)
@@ -39,8 +39,6 @@
import org.axsl.common.para.ParaPenalty;
import org.axsl.orthography.Punctuation;
-import org.slf4j.LoggerFactory;
-
import java.util.ArrayList;
import java.util.List;
@@ -108,8 +106,17 @@
public static final Punctuation4a CLOSE_SQUARE_BRACKET = new Punctuation4a("]");
/** Common punctuation item. */
+ public static final Punctuation4a FORWARD_SLASH = new Punctuation4a("/");
+
+ /** Common punctuation item. */
+ public static final Punctuation4a ELLIPSIS = new Punctuation4a("\u2026");
+
+ /** Common punctuation item. */
public static final Punctuation4a ZERO_WIDTH_SPACE = new Punctuation4a("\u200B");
+ /** Common punctuation item. */
+ public static final Punctuation4a ZERO_WIDTH_NO_BREAK_SPACE = new Punctuation4a("\uFEFF");
+
/** The list of common interword items. */
private static final List<Punctuation4a> COMMON_PUNCTUATION = new ArrayList<Punctuation4a>(25);
static {
@@ -133,7 +140,10 @@
COMMON_PUNCTUATION.add(CLOSE_PAREN);
COMMON_PUNCTUATION.add(OPEN_SQUARE_BRACKET);
COMMON_PUNCTUATION.add(CLOSE_SQUARE_BRACKET);
+ COMMON_PUNCTUATION.add(FORWARD_SLASH);
+ COMMON_PUNCTUATION.add(ELLIPSIS);
COMMON_PUNCTUATION.add(ZERO_WIDTH_SPACE);
+ COMMON_PUNCTUATION.add(ZERO_WIDTH_NO_BREAK_SPACE);
}
@@ -153,7 +163,7 @@
* Using this method instead of a constructor allows this class to reduce unnecessary object creation be reusing
* existing instances of this class instead of creating identical ones.
* @param content The content of the interword item.
- * @return An instance of this class wrapping the given content.
+ * @return An instance of this class wrapping the given content, or null if no instance is found.
*/
public static Punctuation4a findInstance(final CharSequence content) {
for (int index = 0; index < COMMON_PUNCTUATION.size(); index ++) {
@@ -162,8 +172,7 @@
return punctuation;
}
}
- LoggerFactory.getLogger(Punctuation4a.class).warn("Standard punctuation not found: [" + content + "]");
- return new Punctuation4a(content);
+ return null;
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|