From 31bdd39fecb7db1e9fd26f66bfe838bd6e4985c2 Mon Sep 17 00:00:00 2001 From: dchandler Date: Sat, 1 May 2004 19:11:15 +0000 Subject: [PATCH] The TMW for 'da'i was converting to 'aad'i. Andres found this; it is bug 945744. I've made it more correct -- 'ad'i is now produced. The wrong stack is thought to be the root stack still. --- source/org/thdl/tib/text/TibTextUtils.java | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/source/org/thdl/tib/text/TibTextUtils.java b/source/org/thdl/tib/text/TibTextUtils.java index 28bee50..f0cee0e 100644 --- a/source/org/thdl/tib/text/TibTextUtils.java +++ b/source/org/thdl/tib/text/TibTextUtils.java @@ -10,7 +10,7 @@ License for the specific terms governing rights and limitations under the License. The Initial Developer of this software is the Tibetan and Himalayan Digital -Library (THDL). Portions created by the THDL are Copyright 2001-2003 THDL. +Library (THDL). Portions created by the THDL are Copyright 2001-2004 THDL. All Rights Reserved. Contributor(s): ______________________________________. @@ -33,14 +33,13 @@ import org.thdl.tib.text.tshegbar.UnicodeUtils; /** * Provides methods for converting back and forth between Extended -* Wylie and Tibetan represented in TibetanMachineWeb glyphs. This -* class is not instantiable. +* Wylie/ACIP and Tibetan represented in TibetanMachineWeb glyphs. +* This class is not instantiable. * -*

-* The class provides a variety of static methods for converting -* back and forth between Extended Wylie and TibetanMachineWeb. The -* Wylie can be accessed as a String, while the TibetanMachineWeb can -* be exported as Rich Text Format. +*

The class provides a variety of static methods for converting +* back and forth between Extended Wylie or ACIP and TibetanMachineWeb. +* The Wylie/ACIP can be accessed as a String, while the +* TibetanMachineWeb can be exported as Rich Text Format. * * @author Edward Garrett, Tibetan and Himalayan Digital Library */ public class TibTextUtils implements THDLWylieConstants { @@ -1578,6 +1577,17 @@ public class TibTextUtils implements THDLWylieConstants { lastPairTranslit = (EWTSNotACIP ? tp.getWylie(null) : tp.getACIP(null)); + if (!translitBuffer.toString().endsWith(lastPairTranslit)) { + int l; + if ((l = translitBuffer.length()) > 0) { + char lc = translitBuffer.charAt(l - 1); + ThdlDebug.verify(lc == ((EWTSNotACIP) ? 'a' : 'A') /* hard-coded ACIP and EWTS values */); + lastPairTranslit = lastPairTranslit + lc; /* 'da'i can cause this */ + } else { + ThdlDebug.verify(false); // this better never happen. + lastPairTranslit = null; + } + } } for (int i = leftover; i < sz; i++) { TGCPair tp = (TGCPair)gcs.get(i);