diff --git a/source/org/thdl/tib/text/TGCPair.java b/source/org/thdl/tib/text/TGCPair.java index 9049b98..fe3d305 100644 --- a/source/org/thdl/tib/text/TGCPair.java +++ b/source/org/thdl/tib/text/TGCPair.java @@ -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; diff --git a/source/org/thdl/tib/text/TibTextUtils.java b/source/org/thdl/tib/text/TibTextUtils.java index 7b5e418..a191c9c 100644 --- a/source/org/thdl/tib/text/TibTextUtils.java +++ b/source/org/thdl/tib/text/TibTextUtils.java @@ -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);