From 8664571577b85380995f56a729bdb435390db4c9 Mon Sep 17 00:00:00 2001 From: dchandler Date: Sun, 14 Dec 2003 08:38:10 +0000 Subject: [PATCH] Warnings were not being detected correctly. Fixed. ACIP->Unicode uses U+0020, ' ', for whitespace. ACIP->TMW uses the TMW whitespace for whitespace. --- .../org/thdl/tib/text/ttt/ACIPConverter.java | 18 ++++++++---------- source/org/thdl/tib/text/ttt/PackageTest.java | 16 ++++++++-------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/source/org/thdl/tib/text/ttt/ACIPConverter.java b/source/org/thdl/tib/text/ttt/ACIPConverter.java index 6b50b19..fb4524e 100644 --- a/source/org/thdl/tib/text/ttt/ACIPConverter.java +++ b/source/org/thdl/tib/text/ttt/ACIPConverter.java @@ -367,9 +367,8 @@ public class ACIPConverter { tdocLocation[0] += text.length(); } } - + if (null != hasWarnings) hasWarnings[0] = true; if (null != warnings) { - if (null != hasWarnings) hasWarnings[0] = true; warnings.append("Warning: Lexical warning: "); warnings.append(s.getText()); warnings.append('\n'); @@ -488,8 +487,8 @@ public class ACIPConverter { tdocLocation[0] += text.length(); } } + if (null != hasWarnings) hasWarnings[0] = true; if (null != warnings) { - if (null != hasWarnings) hasWarnings[0] = true; warnings.append(warning); warnings.append('\n'); } @@ -563,16 +562,15 @@ public class ACIPConverter { // one) and then a comma: peekaheadFindsSpacesAndComma(scan, i+1))) { if (null != writer) { - unicode = " "; + unicode = " "; // DLC NOW FIXME: allow for U+00A0 between two shads (0F0D or 0F0E), and optionally insert a U+200B after the shad following the whitespace so that stupid software will break lines more nicely done = true; } if (null != tdoc) { - String x = " "; - tdoc.appendRoman(tdocLocation[0], - x, - Color.BLACK); - tdocLocation[0] += x.length(); - continue; + DuffCode spaceDuff = TibetanMachineWeb.getGlyph("_"); + if (null == spaceDuff) throw new Error("whitespace duff"); + tdoc.appendDuffCode(tdocLocation[0]++, + spaceDuff, Color.BLACK); + continue; // FIXME: if null != writer, output was just dropped. } } } else if (s.getText().equals(",") diff --git a/source/org/thdl/tib/text/ttt/PackageTest.java b/source/org/thdl/tib/text/ttt/PackageTest.java index a69b750..02a5d49 100644 --- a/source/org/thdl/tib/text/ttt/PackageTest.java +++ b/source/org/thdl/tib/text/ttt/PackageTest.java @@ -7425,7 +7425,7 @@ M+NA uhelp("^\rGONG SA", "\u0f38\u0f42\u0f7c\u0f44\u0f0b\u0f66"); uhelp("^\r\nGONG SA", "\u0f38\u0f42\u0f7c\u0f44\u0f0b\u0f66"); uhelp("^\nGONG SA", "\u0f38\u0f42\u0f7c\u0f44\u0f0b\u0f66"); - uhelp("^ GONG SA", "[#ERROR CONVERTING ACIP DOCUMENT: Lexical error: The ACIP {^} must precede a tsheg bar.] \u0f42\u0f7c\u0f44\u0f0b\u0f66"); + uhelp("^ GONG SA", "[#ERROR CONVERTING ACIP DOCUMENT: Lexical error: The ACIP {^} must precede a tsheg bar.] \u0f42\u0f7c\u0f44\u0f0b\u0f66"); uhelp("BGLA", "\u0f56\u0f42\u0fb3"); uhelp("BLCAG", "\u0f56\u0f63\u0f95\u0f42"); uhelp("DBA", "[#WARNING CONVERTING ACIP DOCUMENT: The ACIP DBA has been interpreted as two stacks, not one, but you may wish to confirm that the original text had two stacks as it would be an easy mistake to make to see one stack and forget to input it with '+' characters.]\u0f51\u0f56"); @@ -7526,18 +7526,18 @@ M+NA "\u0f04\u0f05\u0f04\u0f05\u0f05\u0f67\u0f74\u0f7e\u0f7f\u0f0b\u0f42\u0fa2\u0f7d\u0f0b\u0f42\u0fb2\u0f7c\u0f08\u0f11\u0f0c\u0f0d"); uhelp("*#HUm: K+DHA GRO`;.,", "\u0f04\u0f05\u0f04\u0f05\u0f05\u0f67\u0f74\u0f7e\u0f7f\u0f0b\u0f40\u0fa2\u0f0b\u0f42\u0fb2\u0f7c\u0f08\u0f11\u0f0c\u0f0d"); - uhelp("HA,\nHA\n\nHA", "\u0f67\u0f0d \u0f67\u0f0b\n\n\u0f67"); + uhelp("HA,\nHA\n\nHA", "\u0f67\u0f0d \u0f67\u0f0b\n\n\u0f67"); uhelp("NGA,", "\u0f44\u0f0c\u0f0d"); - uhelp("NGA,\nHA\n\nHA", "\u0f44\u0f0c\u0f0d \u0f67\u0f0b\n\n\u0f67"); + uhelp("NGA,\nHA\n\nHA", "\u0f44\u0f0c\u0f0d \u0f67\u0f0b\n\n\u0f67"); uhelp("MDO,\n\nKA\n\nHA", "\u0f58\u0f51\u0f7c\u0f0d\n\n\u0f40\u0f0b\n\n\u0f67"); - uhelp("GA ,HA", "\u0f42 \u0f0d\u0f67"); - uhelp("GA ,HA", "\u0f42 \u0f0d\u0f67"); + uhelp("GA ,HA", "\u0f42 \u0f0d\u0f67"); + uhelp("GA ,HA", "\u0f42 \u0f0d\u0f67"); uhelp("GU ,HA", "\u0f42\u0f74\u0f0b\u0f0d\u0f67"); uhelp("MA ,HA", "\u0f58\u0f0b\u0f0d\u0f67"); uhelp("GA HA", "\u0f42\u0f0b\u0f67"); - uhelp("GU, ,KHO", "\u0f42\u0f74\u0f0d \u0f0d\u0f41\u0f7c"); - uhelp("GU ,KHO", "\u0f42\u0f74\u0f0b \u0f0d\u0f41\u0f7c"); // FIXME: missing a shad after GU, warn about that. - uhelp("GA HA", "\u0f42\u0f0b \u0f67"); + uhelp("GU, ,KHO", "\u0f42\u0f74\u0f0d \u0f0d\u0f41\u0f7c"); + uhelp("GU ,KHO", "\u0f42\u0f74\u0f0b \u0f0d\u0f41\u0f7c"); // FIXME: missing a shad after GU, warn about that. + uhelp("GA HA", "\u0f42\u0f0b \u0f67"); } public void testFixedFormSubjoinedConsonants() { // Usual subjoined RA: