org.thdl.tib.text.tshegbar
Class LegalTshegBar

java.lang.Object
  |
  +--org.thdl.tib.text.tshegbar.TshegBar
        |
        +--org.thdl.tib.text.tshegbar.LegalTshegBar
All Implemented Interfaces:
UnicodeConstants, UnicodeReadyThunk

public class LegalTshegBar
extends TshegBar
implements UnicodeConstants

A LegalTshegBar is a simple Tibetan syllable or a syllable with syntactically legal suffix particles. A legal tsheg-bar is not a transliteration of Chinese or some other language. It obeys the following properties:

Note that this class uses only a subset of Unicode to represent consonants and vowels. In some situations, you should use UnicodeConstants.EWSUB_wa_zur to represent the consonant wa, while in others you should use UnicodeConstants.EWC_wa, even though you mean to subscribe a fixed-form wa. Basically, stick to the codepoints for which enumerations exist in UnicodeConstants and use your common sense.

For a pretty good, concise summary of the rules this class knows about, see Joe B. Wilson's Translating Buddhism from Tibetan from Snow Lion Publications, Appendix 1, e.g. p. 548.

Author:
David Chandler

Field Summary
 
Fields inherited from interface org.thdl.tib.text.tshegbar.UnicodeConstants
EW_ABSENT, EW_achung, EWC_a, EWC_achen, EWC_ba, EWC_ca, EWC_cha, EWC_da, EWC_dza, EWC_ga, EWC_ha, EWC_ja, EWC_ka, EWC_kha, EWC_la, EWC_ma, EWC_na, EWC_nga, EWC_nya, EWC_pa, EWC_pha, EWC_ra, EWC_sa, EWC_sha, EWC_ta, EWC_tha, EWC_tsa, EWC_tsha, EWC_wa, EWC_ya, EWC_za, EWC_zha, EWSUB_la_btags, EWSUB_ra_btags, EWSUB_wa_zur, EWSUB_ya_btags, EWV_e, EWV_i, EWV_o, EWV_u, NORM_NFC, NORM_NFD, NORM_NFKC, NORM_NFKD, NORM_NFTHDL, NORM_UNNORMALIZED
 
Constructor Summary
LegalTshegBar(char prefix, char headLetter, char rootLetter, char subjoinedLetter, boolean hasWaZur, boolean hasAChung, char suffix, char postsuffix, char vowel)
          Like LegalTshegBar(char,char,char,char,boolean,boolean,String,char,char) but geared for the common case where the suffix is simply a consonant.
LegalTshegBar(char prefix, char headLetter, char rootLetter, char subjoinedLetter, boolean hasWaZur, boolean hasAChung, String suffix, char postsuffix, char vowel)
          Constructs a valid Tibetan syllable or throws an exception.
 
Method Summary
static boolean formsLegalTshegBar(char prefix, char headLetter, char rootLetter, char subjoinedLetter, boolean hasWaZur, boolean hasAChung, char suffix, char postsuffix, char vowel)
          Like formsLegalTshegBar(char,char,char,char,boolean,boolean,String,char,char) but geared for the common case where the suffix is simply a consonant.
static boolean formsLegalTshegBar(char prefix, char headLetter, char rootLetter, char subjoinedLetter, boolean hasWaZur, boolean hasAChung, String suffix, char postsuffix, char vowel)
          Returns true iff the given arguments form a legal Tibetan syllable.
static String getConnectiveCaseSuffix()
          Returns a two-codepoint string consisting of the Unicode representation of what THDL Extended Wylie calls 'i.
 char getHeadLetter()
          Returns the head letter of the root stack if it has one, or EW_ABSENT otherwise.
static String getPossiblePostsuffixes()
          Returns a string of two codepoints, da and sa.
static String getPossibleSuffixes()
          Returns a string of ten codepoints, each of which can be a suffix in Tibetan.
static String[] getPossibleSuffixParticles()
          Returns an array of Unicode strings, all the legal suffix particles.
 char getPostsuffix()
          Returns the secondary suffix, which is either EWC_da or EWC_sa, or EW_ABSENT if there is no postsuffix.
 char getPrefix()
          Returns the prefixed consonant, or EW_ABSENT if there is no prefix.
 char getRootLetter()
          Returns the root consonant.
 char getSimpleSuffix()
          If this syllable has a simple suffix, this returns it.
 char getSubjoinedLetter()
          Returns the non-EWSUB_wa_zur consonant subscribed to the root consonant, or EW_ABSENT if none is.
 String getSuffix()
          Returns null if there is no suffix, or a string containing the one consonant or a string "\u0F60\u0F72" containing two codepoints in the special case that the suffix is that connective case marker getConnectiveCaseSuffix().
 StringBuffer getThdlWylie()
          Returns a StringBuffer that holds the THDL extended wylie representation of this syllable.
static String getTheFivePrefixes()
          Returns a String containing the nominal Unicode representations of the five prefixes.
static String getTheTenSuffixes()
          Returns a String containing the nominal Unicode representations of the ten suffixes.
static String getTheThirtyConsonants()
          Returns a String containing the nominal Unicode representations of the thirty consonants.
 String getUnicodeRepresentation()
          Overrides UnicodeReadyThunk method to return NFKD-normalized Unicode.
 char getVowel()
          Returns the vowel, or EW_ABSENT if there is no explicit vowel (the syllable has the built-in "ah" sound in this case).
 boolean hasAChungOnRootLetter()
           
 boolean hasConnectiveCaseMarkerSuffix()
          Returns true iff this syllable has a 'i suffix.
 boolean hasExplicitVowel()
          Returns false iff the implicit, built-in "ah" sound is the only vowel for the root stack.
 boolean hasHeadLetter()
          Returns true iff this syllable has a head letter.
 boolean hasPostsuffix()
          Returns true iff there is a secondary suffix EWC_da or EWC_sa.
 boolean hasPrefix()
          Returns true iff this syllable contains a prefixed consonant.
 boolean hasSimpleSuffix()
          Returns true iff there is a single, suffixed consonant.
 boolean hasSubjoinedLetter()
          Returns true iff the root letter possesses a subscribed consonant ya-btags, ra-btags, la-btags, or wa-zur.
 boolean hasSuffix()
          Returns true iff there is a suffixed consonant or a suffixed 'i (DLC FIXME).
 boolean hasUnicodeRepresentation()
          Overrides UnicodeReadyThunk method to return true.
 boolean hasWaZurSubjoinedToRootLetter()
           
static boolean isConsonantThatTakesLaBtags(char rootLetter)
          Returns true iff rootLetter is a consonant to which la-btags can be subjoined.
static boolean isConsonantThatTakesLaMgo(char rootLetter)
          Returns true iff rootLetter is a consonant that takes a la-mgo (pronounced lango because ma is a prenasaling prefix) head letter
static boolean isConsonantThatTakesRaBtags(char rootLetter)
          Returns true iff rootLetter is a consonant to which ra-btags can be subjoined.
static boolean isConsonantThatTakesRaMgo(char rootLetter)
          Returns true iff rootLetter is a consonant that takes a ra-mgo (pronounced rango because ma is a prenasaling prefix) head letter
static boolean isConsonantThatTakesSaMgo(char rootLetter)
          Returns true iff rootLetter is a consonant that takes a sa-mgo (pronounced sango because ma is a prenasaling prefix) head letter
static boolean isConsonantThatTakesWaZur(char rootLetter)
          Returns true iff rootLetter is a consonant to which wa-zur can be subjoined (perhaps in addition to another subjoined ra-btags or ya-btags.
static boolean isConsonantThatTakesYaBtags(char rootLetter)
          Returns true iff rootLetter is a consonant to which ya-btags can be subjoined.
static boolean isNominalRepresentationOfConsonant(char x)
          Returns true iff x is the preferred, nominal Unicode representation of one the thirty consonants.
static boolean isNominalRepresentationOfPrefix(char x)
          Returns true iff x is the preferred, nominal Unicode representation of one of the five prefixes.
static boolean isNominalRepresentationOfSimpleSuffix(char x)
          Returns true iff x is the preferred, nominal Unicode representation of one of the ten suffixes.
static boolean takesWaZur(char rootLetter, char subjoinedLetter)
          Returns true iff the given (rootLetter, subjoinedLetter) combination can accept an additional wa-zur.
 String toConciseXML()
          Returns a element that contains only the THDL Extended Wylie transliteration for the whole syllable and a note about the transliteration.
 String toString()
          Returns a descriptive XML element.
 String toVerboseXML()
          Returns a element that contains the syllable broken-down into its constituent vowel and consonants.
 
Methods inherited from class org.thdl.tib.text.tshegbar.TshegBar
isTibetan
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LegalTshegBar

public LegalTshegBar(char prefix,
                     char headLetter,
                     char rootLetter,
                     char subjoinedLetter,
                     boolean hasWaZur,
                     boolean hasAChung,
                     String suffix,
                     char postsuffix,
                     char vowel)
              throws IllegalArgumentException
Constructs a valid Tibetan syllable or throws an exception. Use EW_ABSENT (or null in the case of suffix) for those parts of the syllable that are absent. The root letter must not be absent. To learn about the arguments, and to be sure that your input won't cause an exception to be thrown, see formsLegalTshegBar(char,char,char,char,boolean,boolean,String,char,char).

Throws:
IllegalArgumentException - if the rootLetter is not one of the thirty consonants (and represented nominally, at that), or if one of the other arguments is not valid, or if postsuffix is present but suffix is absent, etc.

LegalTshegBar

public LegalTshegBar(char prefix,
                     char headLetter,
                     char rootLetter,
                     char subjoinedLetter,
                     boolean hasWaZur,
                     boolean hasAChung,
                     char suffix,
                     char postsuffix,
                     char vowel)
              throws IllegalArgumentException
Like LegalTshegBar(char,char,char,char,boolean,boolean,String,char,char) but geared for the common case where the suffix is simply a consonant.

Method Detail

getPrefix

public char getPrefix()
Returns the prefixed consonant, or EW_ABSENT if there is no prefix.


hasPrefix

public boolean hasPrefix()
Returns true iff this syllable contains a prefixed consonant.


getSubjoinedLetter

public char getSubjoinedLetter()
Returns the non-EWSUB_wa_zur consonant subscribed to the root consonant, or EW_ABSENT if none is. If you want to know if there is a wa-zur, use hasWaZurSubjoinedToRootLetter()


hasSubjoinedLetter

public boolean hasSubjoinedLetter()
Returns true iff the root letter possesses a subscribed consonant ya-btags, ra-btags, la-btags, or wa-zur.


hasWaZurSubjoinedToRootLetter

public boolean hasWaZurSubjoinedToRootLetter()

hasAChungOnRootLetter

public boolean hasAChungOnRootLetter()

getSuffix

public String getSuffix()
Returns null if there is no suffix, or a string containing the one consonant or a string "\u0F60\u0F72" containing two codepoints in the special case that the suffix is that connective case marker getConnectiveCaseSuffix().


hasSuffix

public boolean hasSuffix()
Returns true iff there is a suffixed consonant or a suffixed 'i (DLC FIXME).


hasSimpleSuffix

public boolean hasSimpleSuffix()
Returns true iff there is a single, suffixed consonant. This means that suffixes like 'am, 'i, 'u, and 'o are not present, but this does not rule out the presence of a postsuffix.


getSimpleSuffix

public char getSimpleSuffix()
                     throws Exception
If this syllable has a simple suffix, this returns it.

Throws:
Exception - if hasSimpleSuffix() is not true

getPostsuffix

public char getPostsuffix()
Returns the secondary suffix, which is either EWC_da or EWC_sa, or EW_ABSENT if there is no postsuffix.


hasPostsuffix

public boolean hasPostsuffix()
Returns true iff there is a secondary suffix EWC_da or EWC_sa.


hasConnectiveCaseMarkerSuffix

public boolean hasConnectiveCaseMarkerSuffix()
Returns true iff this syllable has a 'i suffix.


getRootLetter

public char getRootLetter()
Returns the root consonant.


getHeadLetter

public char getHeadLetter()
Returns the head letter of the root stack if it has one, or EW_ABSENT otherwise.


hasHeadLetter

public boolean hasHeadLetter()
Returns true iff this syllable has a head letter.


getVowel

public char getVowel()
Returns the vowel, or EW_ABSENT if there is no explicit vowel (the syllable has the built-in "ah" sound in this case).


hasExplicitVowel

public boolean hasExplicitVowel()
Returns false iff the implicit, built-in "ah" sound is the only vowel for the root stack.


getPossiblePostsuffixes

public static String getPossiblePostsuffixes()
Returns a string of two codepoints, da and sa.


getPossibleSuffixes

public static String getPossibleSuffixes()
Returns a string of ten codepoints, each of which can be a suffix in Tibetan.


getConnectiveCaseSuffix

public static String getConnectiveCaseSuffix()
Returns a two-codepoint string consisting of the Unicode representation of what THDL Extended Wylie calls 'i.


getTheThirtyConsonants

public static String getTheThirtyConsonants()
Returns a String containing the nominal Unicode representations of the thirty consonants. The consonants are in the usual order you find them in the 8 row by 4 column table that students of the language memorize.

See Also:
UnicodeConstants

isNominalRepresentationOfConsonant

public static boolean isNominalRepresentationOfConsonant(char x)
Returns true iff x is the preferred, nominal Unicode representation of one the thirty consonants.


getPossibleSuffixParticles

public static String[] getPossibleSuffixParticles()
Returns an array of Unicode strings, all the legal suffix particles. In THDL Extended Wylie, these are:

This is not very efficient.


getTheFivePrefixes

public static String getTheFivePrefixes()
Returns a String containing the nominal Unicode representations of the five prefixes. The prefixes are in dictionary order.

See Also:
UnicodeConstants

isNominalRepresentationOfPrefix

public static boolean isNominalRepresentationOfPrefix(char x)
Returns true iff x is the preferred, nominal Unicode representation of one of the five prefixes.


getTheTenSuffixes

public static String getTheTenSuffixes()
Returns a String containing the nominal Unicode representations of the ten suffixes. The suffixes are in dictionary order.

See Also:
getConnectiveCaseSuffix(), UnicodeConstants

isNominalRepresentationOfSimpleSuffix

public static boolean isNominalRepresentationOfSimpleSuffix(char x)
Returns true iff x is the preferred, nominal Unicode representation of one of the ten suffixes.

See Also:
getConnectiveCaseSuffix()

takesWaZur

public static boolean takesWaZur(char rootLetter,
                                 char subjoinedLetter)
Returns true iff the given (rootLetter, subjoinedLetter) combination can accept an additional wa-zur. Only g-r-w, d-r-w, and ph-y-w fall into this category according to tibwn.ini. (DLC FIXME: are these all legal? are any others?)

Parameters:
rootLetter - the root consonant (in preferred form in you expect true to be returned)
subjoinedLetter - the letter subscribed to rootLetter, which should not be wa if you expect true to be returned
Returns:
true iff (rootLetter, subjoinedLetter, wa-zur) is a legal stack.

isConsonantThatTakesWaZur

public static boolean isConsonantThatTakesWaZur(char rootLetter)
Returns true iff rootLetter is a consonant to which wa-zur can be subjoined (perhaps in addition to another subjoined ra-btags or ya-btags.


isConsonantThatTakesYaBtags

public static boolean isConsonantThatTakesYaBtags(char rootLetter)
Returns true iff rootLetter is a consonant to which ya-btags can be subjoined.


isConsonantThatTakesLaBtags

public static boolean isConsonantThatTakesLaBtags(char rootLetter)
Returns true iff rootLetter is a consonant to which la-btags can be subjoined.


isConsonantThatTakesRaBtags

public static boolean isConsonantThatTakesRaBtags(char rootLetter)
Returns true iff rootLetter is a consonant to which ra-btags can be subjoined.


isConsonantThatTakesRaMgo

public static boolean isConsonantThatTakesRaMgo(char rootLetter)
Returns true iff rootLetter is a consonant that takes a ra-mgo (pronounced rango because ma is a prenasaling prefix) head letter


isConsonantThatTakesLaMgo

public static boolean isConsonantThatTakesLaMgo(char rootLetter)
Returns true iff rootLetter is a consonant that takes a la-mgo (pronounced lango because ma is a prenasaling prefix) head letter


isConsonantThatTakesSaMgo

public static boolean isConsonantThatTakesSaMgo(char rootLetter)
Returns true iff rootLetter is a consonant that takes a sa-mgo (pronounced sango because ma is a prenasaling prefix) head letter


formsLegalTshegBar

public static boolean formsLegalTshegBar(char prefix,
                                         char headLetter,
                                         char rootLetter,
                                         char subjoinedLetter,
                                         boolean hasWaZur,
                                         boolean hasAChung,
                                         String suffix,
                                         char postsuffix,
                                         char vowel)
Returns true iff the given arguments form a legal Tibetan syllable.

Parameters:
prefix - the optional, prefixed consonant
headLetter - the optional superscribed consonant
rootLetter - the mandatory root consonant
subjoinedLetter - the optional, subscribed consonant
suffix - the optional suffix, which is null, a String consisting of a single consonant (i.e. a single, nondecomposable codepoint) except in the special case that this is getConnectiveCaseSuffix()
postsuffix - the optional postsuffix, which should be EWC_sa or EWC_da
vowel - the optional vowel

formsLegalTshegBar

public static boolean formsLegalTshegBar(char prefix,
                                         char headLetter,
                                         char rootLetter,
                                         char subjoinedLetter,
                                         boolean hasWaZur,
                                         boolean hasAChung,
                                         char suffix,
                                         char postsuffix,
                                         char vowel)
Like formsLegalTshegBar(char,char,char,char,boolean,boolean,String,char,char) but geared for the common case where the suffix is simply a consonant.


getThdlWylie

public StringBuffer getThdlWylie()
Returns a StringBuffer that holds the THDL extended wylie representation of this syllable.


toConciseXML

public String toConciseXML()
Returns a element that contains only the THDL Extended Wylie transliteration for the whole syllable and a note about the transliteration.


toVerboseXML

public String toVerboseXML()
Returns a element that contains the syllable broken-down into its constituent vowel and consonants.


getUnicodeRepresentation

public String getUnicodeRepresentation()
Overrides UnicodeReadyThunk method to return NFKD-normalized Unicode.

Specified by:
getUnicodeRepresentation in interface UnicodeReadyThunk
Returns:
a String of Unicode codepoints
Throws:
UnsupportedOperationException - is never thrown

hasUnicodeRepresentation

public boolean hasUnicodeRepresentation()
Overrides UnicodeReadyThunk method to return true.

Specified by:
hasUnicodeRepresentation in interface UnicodeReadyThunk

toString

public String toString()
Returns a descriptive XML element.

Overrides:
toString in class Object


These API docs were created 02/02/2003 08:19 PM.
Copyright © 2001-2002 Tibetan and Himalayan Digital Library. All Rights Reserved.
Hosted by SourceForge_Logo