Added utility routine. Better comments.

This commit is contained in:
dchandler 2003-08-31 20:38:28 +00:00
parent 045c4069c9
commit cc9ab06864
2 changed files with 22 additions and 5 deletions

View file

@ -37,6 +37,23 @@ public class TGCPair {
public static final int SANSKRIT_WITHOUT_VOWEL = 5;
public static final int SANSKRIT_WITH_VOWEL = 6;
/** Returns a human-readable (well, programmer-readable)
representation of one of the public enumerations in this
class. */
public static final String enumToString(int cls) {
if (OTHER == cls) return "OTHER";
if (LONE_VOWEL == cls) return "LONE_VOWEL";
if (SANSKRIT_WITH_VOWEL == cls) return "SANSKRIT_WITH_VOWEL";
if (SANSKRIT_WITHOUT_VOWEL == cls) return "SANSKRIT_WITHOUT_VOWEL";
if (CONSONANTAL_WITH_VOWEL == cls) return "CONSONANTAL_WITH_VOWEL";
if (CONSONANTAL_WITHOUT_VOWEL == cls) return "CONSONANTAL_WITHOUT_VOWEL";
if (TYPE_OTHER == cls) return "TYPE_OTHER";
if (TYPE_SANSKRIT == cls) return "TYPE_SANSKRIT";
if (TYPE_TIBETAN == cls) return "TYPE_TIBETAN";
return null;
}
public static final int TYPE_OTHER = 31;
public static final int TYPE_SANSKRIT = 32;
public static final int TYPE_TIBETAN = 33;

View file

@ -828,6 +828,9 @@ public class TibTextUtils implements THDLWylieConstants {
return (MA.equals(wylie) || NGA.equals(wylie));
}
// DLC FIXME: {H}, U+0F7F, is part of a grapheme cluster!
// David Chapman and I both need a comprehensive list of these
// guys.
/** Scans the glyphs in glyphList and creates the returned list of
grapheme clusters based on them. A grapheme cluster is a
consonant or consonant stack with optional adornment or a
@ -835,12 +838,9 @@ public class TibTextUtils implements THDLWylieConstants {
alone. */
private static TGCList breakTshegBarIntoGraphemeClusters(java.util.List glyphList,
boolean noSuchWylie[]) {
// Definition: adornment means vowels and achungs and bindus.
// DLC FIXME: {H}, U+0F7F, is part of a grapheme cluster!
// David Chapman and I both need a comprehensive list of these
// guys.
// It should be this, though (FIXME): any combining
// characters.
int sz = glyphList.size();
ThdlDebug.verify(sz > 0);