From 7acbce336164d8c35954f04da14484b1cc6da665 Mon Sep 17 00:00:00 2001 From: dchandler Date: Sun, 6 Jun 2004 21:59:16 +0000 Subject: [PATCH] Added errors 142 and 143, which are produced when converting yig chung to a Unicode text file, which cannot support font size changes. --- source/org/thdl/tib/text/ttt/ACIPConverter.java | 10 ++++++++++ source/org/thdl/tib/text/ttt/ErrorsAndWarnings.java | 6 +++++- source/org/thdl/tib/text/ttt/PackageTest.java | 5 +++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/source/org/thdl/tib/text/ttt/ACIPConverter.java b/source/org/thdl/tib/text/ttt/ACIPConverter.java index 6c3c8c5..97f977b 100644 --- a/source/org/thdl/tib/text/ttt/ACIPConverter.java +++ b/source/org/thdl/tib/text/ttt/ACIPConverter.java @@ -675,11 +675,21 @@ public class ACIPConverter { } } } else if (stype == TString.START_PAREN) { + if (null != writer) + writer.write("[ERROR " + + ErrorsAndWarnings.getMessage(142, + shortMessages, + "(" /* hard-coded ACIP value */) + "]"); if (null != tdoc) { tdoc.setTibetanFontSize(smallFontSize); } continue; } else if (stype == TString.END_PAREN) { + if (null != writer) + writer.write("[ERROR " + + ErrorsAndWarnings.getMessage(143, + shortMessages, + ")" /* hard-coded ACIP value */) + "]"); if (null != tdoc) { tdoc.setTibetanFontSize(regularFontSize); } diff --git a/source/org/thdl/tib/text/ttt/ErrorsAndWarnings.java b/source/org/thdl/tib/text/ttt/ErrorsAndWarnings.java index 65af97e..9d1de0a 100644 --- a/source/org/thdl/tib/text/ttt/ErrorsAndWarnings.java +++ b/source/org/thdl/tib/text/ttt/ErrorsAndWarnings.java @@ -252,7 +252,11 @@ public class ErrorsAndWarnings { ThdlDebug.verify(translit.length() == 1); return "" + code + ": While waiting for a closing bracket, an opening bracket, '" + translit + "', was found instead. Nesting of bracketed expressions is not permitted."; + case 142: // this number is referenced in error 143's message + return "" + code + ": Because you requested conversion to a Unicode text file, there is no way to indicate that the font size is supposed to decrease starting here and continuing until error 143. That is, this is the beginning of a region in YIG CHUNG."; + case 143: // this number is referenced in error 142's message + return "" + code + ": Because you requested conversion to a Unicode text file, there is no way to indicate that the font size is supposed to increase (go back to the size it was before the last error 142, that is) starting here. That is, this is the end of a region in YIG CHUNG."; @@ -326,7 +330,7 @@ public class ErrorsAndWarnings { } private static final int MIN_ERROR = 101; // inclusive - private static final int MAX_ERROR = 141; // inclusive + private static final int MAX_ERROR = 143; // inclusive private static final int MIN_WARNING = 501; // inclusive private static final int MAX_WARNING = 512; // inclusive diff --git a/source/org/thdl/tib/text/ttt/PackageTest.java b/source/org/thdl/tib/text/ttt/PackageTest.java index 47240e9..6e26191 100644 --- a/source/org/thdl/tib/text/ttt/PackageTest.java +++ b/source/org/thdl/tib/text/ttt/PackageTest.java @@ -10323,6 +10323,11 @@ tstHelper("shKA"); } public void testBrackets() { + uhelp("GA (GA )KHA ", + "\u0f42\u0f0b[ERROR 142: Because you requested conversion to a Unicode text file, there is no way to indicate that the font size is supposed to decrease starting here and continuing until error 143. That is, this is the beginning of a region in YIG CHUNG.]\u0f42\u0f0b[ERROR 143: Because you requested conversion to a Unicode text file, there is no way to indicate that the font size is supposed to increase (go back to the size it was before the last error 142, that is) starting here. That is, this is the end of a region in YIG CHUNG.]\u0f41\u0f0b"); + uhelp("(GA (GA )KHA )", + "[ERROR 142: Because you requested conversion to a Unicode text file, there is no way to indicate that the font size is supposed to decrease starting here and continuing until error 143. That is, this is the beginning of a region in YIG CHUNG.]\u0f42\u0f0b[#ERROR 111: Found an illegal open parenthesis, '('. Nesting of parentheses is not allowed.]\u0f42\u0f0b[ERROR 143: Because you requested conversion to a Unicode text file, there is no way to indicate that the font size is supposed to increase (go back to the size it was before the last error 142, that is) starting here. That is, this is the end of a region in YIG CHUNG.]\u0f41\u0f0b[#ERROR 112: Unexpected closing parenthesis, ')', found.]"); + if (ACIPTshegBarScanner.BRACKETED_SECTIONS_PASS_THROUGH_UNMODIFIED) { uhelpShortMessages("{ DD }", " DD "); uhelpShortMessages("{D X}", "D X");