Bulletproofing and debugging support.

This commit is contained in:
dchandler 2003-10-16 04:13:14 +00:00
parent 129ebccd67
commit 5f4fbfab7c
2 changed files with 12 additions and 10 deletions

View file

@ -569,7 +569,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (vowel.equals(WYLIE_aVOWEL) if (vowel.equals(WYLIE_aVOWEL)
|| TibetanMachineWeb.isTopVowel(context_2)) { || TibetanMachineWeb.isTopVowel(context_2)) {
if (TibetanMachineWeb.isTopVowel(context_2)) if (TibetanMachineWeb.isTopVowel(context_2))
throw new IllegalArgumentException("dropping vowels is bad"); throw new IllegalArgumentException("dropping vowels is bad1");
if (!context_added[0]) { if (!context_added[0]) {
context_added[0] = true; context_added[0] = true;
if (context_1 != null) if (context_1 != null)
@ -622,7 +622,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (!TibetanMachineWeb.isTopVowel(context_2)) { if (!TibetanMachineWeb.isTopVowel(context_2)) {
DuffCode[] dc_v = (DuffCode[])TibetanMachineWeb.getTibHash().get(reverse_i_VOWEL); DuffCode[] dc_v = (DuffCode[])TibetanMachineWeb.getTibHash().get(reverse_i_VOWEL);
l.add(dc_v[TibetanMachineWeb.TMW]); l.add(dc_v[TibetanMachineWeb.TMW]);
} else throw new IllegalArgumentException("dropping vowels is bad"); } else throw new IllegalArgumentException("dropping vowels is bad2");
return; return;
} }
@ -652,7 +652,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (null != dc_v) if (null != dc_v)
l.add(dc_v); l.add(dc_v);
else throw new IllegalArgumentException("dropping vowels is bad"); else throw new IllegalArgumentException("dropping vowels is bad3");
return; return;
} }
@ -676,7 +676,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (null != dc_v) if (null != dc_v)
l.add(dc_v); l.add(dc_v);
else throw new IllegalArgumentException("dropping vowels is bad"); else throw new IllegalArgumentException("dropping vowels is bad4");
return; return;
} }
@ -699,7 +699,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (null != dc_v) if (null != dc_v)
l.add(dc_v); l.add(dc_v);
else throw new IllegalArgumentException("dropping vowels is bad"); else throw new IllegalArgumentException("dropping vowels is bad5");
return; return;
} }
@ -728,7 +728,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (null != dc_v) if (null != dc_v)
l.add(dc_v); l.add(dc_v);
else throw new IllegalArgumentException("dropping vowels is bad"); else throw new IllegalArgumentException("dropping vowels is bad6");
return; return;
} }
@ -751,7 +751,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (null != dc_v) if (null != dc_v)
l.add(dc_v); l.add(dc_v);
else throw new IllegalArgumentException("dropping vowels is bad"); else throw new IllegalArgumentException("dropping vowels is bad7");
return; return;
} }
@ -774,7 +774,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (null != dc_v && !TibetanMachineWeb.isTopVowel(context_2)) if (null != dc_v && !TibetanMachineWeb.isTopVowel(context_2))
l.add(dc_v); l.add(dc_v);
else throw new IllegalArgumentException("dropping vowels is bad"); else throw new IllegalArgumentException("dropping vowels is bad8");
return; return;
} }
@ -804,7 +804,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (null != dc_v_sub && null != dc_v_sup) { if (null != dc_v_sub && null != dc_v_sup) {
l.add(dc_v_sub); l.add(dc_v_sub);
l.add(dc_v_sup); l.add(dc_v_sup);
} else throw new IllegalArgumentException("dropping vowels is bad"); } else throw new IllegalArgumentException("dropping vowels is bad9");
return; return;
} }
@ -830,7 +830,7 @@ public class TibTextUtils implements THDLWylieConstants {
if (null != dc_v_sub && null != dc_v_sup) { if (null != dc_v_sub && null != dc_v_sup) {
l.add(dc_v_sub); l.add(dc_v_sub);
l.add(dc_v_sup); l.add(dc_v_sup);
} else throw new IllegalArgumentException("dropping vowels is bad"); } else throw new IllegalArgumentException("dropping vowels is bad10");
return; return;
} }
@ -1240,6 +1240,7 @@ public class TibTextUtils implements THDLWylieConstants {
} }
lastPair = tp; lastPair = tp;
} }
if (null == candidateType) candidateType = "invalid";
if (candidateType.startsWith("maybe-appendaged-")) { if (candidateType.startsWith("maybe-appendaged-")) {
if (null != warnings) if (null != warnings)
warnings.append("Found a tsheg bar that has an extra achung (" + ACHUNG + ") tacked on\n"); warnings.append("Found a tsheg bar that has an extra achung (" + ACHUNG + ") tacked on\n");

View file

@ -1679,6 +1679,7 @@ public static String getHashKeyForGlyph(int font, int code) {
public static String getHashKeyForGlyph(DuffCode dc) { public static String getHashKeyForGlyph(DuffCode dc) {
int font = dc.getFontNum(); int font = dc.getFontNum();
int code = dc.getCharNum()-32; int code = dc.getCharNum()-32;
if (code < 0) return null;
return toHashKey[font][code]; return toHashKey[font][code];
} }