|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.thdl.tib.text.TibetanMachineWeb
Interfaces between Extended Wylie and the TibetanMachineWeb fonts. To do this this must first read the code table, which lives in "tibwn.ini", and which must be found in the same directory as this class. Note that WylieWord has its own copy of this file, so edit both or neither.
In addition, this class optionally loads the TibetanMachineWeb
fonts manually via #readInFontFiles()
.
Field Summary | |
static String |
A_VOWEL
the Wylie for the subscript achung vowel |
static String |
ACHEN
the Wylie for achen |
static String |
ACHUNG
the Wylie for achung |
static String |
ai_VOWEL
the Wylie for double drengbu |
static String |
au_VOWEL
the Wylie for double naro |
static char |
BINDU
the Wylie for bindu/anusvara |
static String |
e_VOWEL
the Wylie for drengbu |
static int |
HALF_C
represents where in an array of DuffCodes you find the half height equivalence of a given glyph |
static String |
i_VOWEL
the Wylie for gigu |
static String |
I_VOWEL
the Wylie for the vowel achung + gigu |
static String |
o_VOWEL
the Wylie for naro |
static int |
REDUCED_C
represents where in an array of DuffCodes you find the reduced character equivalent of a TMW glyph |
static String |
reverse_i_VOWEL
the Wylie for log yig gigu |
static String |
reverse_I_VOWEL
the Wylie for the vowel achung + log yig gigu |
static char |
SPACE
the Wylie for whitespace |
static int |
TM
represents where in an array of DuffCodes you find the TibetanMachine equivalence of a glyph |
static String[] |
tmFontNames
|
static int |
TMW
represents where in an array of DuffCodes you find the TibetanMachineWeb glyph |
static String[] |
tmwFontNames
|
static char |
TSHEG
the Wylie for tsheg |
static String |
u_VOWEL
the Wylie for zhebju |
static String |
U_VOWEL
the Wylie for the vowel achung + zhebju |
static int |
UNICODE
represents where in an array of DuffCodes you find the Unicode equivalence of a given glyph |
static int |
VOWEL_A
represents where in an array of DuffCodes you find the achung value for a given glyph |
static int |
VOWEL_e
represents where in an array of DuffCodes you find the drengbu value for a given glyph |
static int |
VOWEL_i
represents where in an array of DuffCodes you find the gigu value for a given glyph |
static int |
VOWEL_o
represents where in an array of DuffCodes you find the naro value for a given glyph |
static int |
VOWEL_u
represents where in an array of DuffCodes you find the zhebju value for a given glyph |
static int |
VOWEL_U
represents where in an array of DuffCodes you find the achung + zhebju value for a given glyph |
static String |
WYLIE_aVOWEL
the Wylie for the invisible 'a' vowel |
static char |
WYLIE_DISAMBIGUATING_KEY
the Wylie disambiguating key, as a char |
static char |
WYLIE_SANSKRIT_STACKING_KEY
the Sanskrit stacking separator used in Extended Wylie |
Constructor Summary | |
TibetanMachineWeb()
|
Method Summary | |
static boolean |
currentKeyboardIsExtendedWylie()
Returns true iff the currently active keyboard is the built-in, extended Wylie keyboard. |
static SimpleAttributeSet |
getAttributeSet(int font)
Gets the AttributeSet for the given TibetanMachineWeb font. |
static String |
getAVowel()
Gets the invisible 'a' vowel. |
static Map |
getBinduMap()
Gets the hash for characters that require special bindus. |
static char |
getDisambiguatingKey()
Gets the disambiguating key. |
static org.thdl.tib.text.DuffCode |
getGlyph(String hashKey)
Gets a glyph for this hash key. |
static org.thdl.tib.text.DuffCode |
getHalfHeightGlyph(String hashKey)
Gets the half height character for this hash key. |
static String |
getHashKeyForGlyph(org.thdl.tib.text.DuffCode dc)
Gets the hash key associated with this glyph. |
static String |
getHashKeyForGlyph(int font,
int code)
Gets the hash key associated with this glyph. |
static org.thdl.tib.text.TibetanKeyboard |
getKeyboard()
Returns the current keyboard, or, if the current keyboard is the Extended Wylie keyboard, null. |
static char |
getStackingKey()
Gets the stacking key. |
static Map |
getTibHash()
Gets the hash with information about each character and stack. |
static int |
getTMWFontNumber(String name)
Gets the TibetanMachineWeb font number for this font name. |
static org.thdl.tib.text.DuffCode |
getVowel(String hashKey,
int vowel)
Gets the DuffCode required for a vowel, if affixed to the given hashKey. |
static String |
getWylieForChar(String s)
Converts character to its Extended Wylie correspondence. |
static String |
getWylieForGlyph(org.thdl.tib.text.DuffCode dc)
Gets the Extended Wylie value for this glyph. |
static String |
getWylieForGlyph(int font,
int code)
Gets the Extended Wylie value for this glyph. |
static String |
getWylieForPunc(String s)
Converts punctuation to its Extended Wylie correspondence. |
static String |
getWylieForVowel(String s)
Converts vowel to its Extended Wylie correspondence. |
static boolean |
hasAVowel()
Returns true iff there is a key for the invisible 'a' vowel in this keyboard. |
static boolean |
hasDisambiguatingKey()
Returns true iff the keyboard has a disambiguating key. |
static boolean |
hasGlyph(String hashKey)
Checks to see if a glyph exists for this hash key. |
static boolean |
hasInputPrefix(String s)
This addresses bug 624133, "Input freezes after impossible character". |
static boolean |
hasSanskritStackingKey()
Returns true iff the keyboard has a Sanksrit stacking key. |
static boolean |
hasTibetanStackingKey()
Returns true iff the keyboard has a Tibetan stacking key. |
static boolean |
isAChenRequiredBeforeVowel()
Returns true iff achen is required before vowels. |
static boolean |
isAChungConsonant()
Returns true iff achung is treated as a consonant. |
static boolean |
isChar(String s)
Checks to see if the passed string is a character in the installed keyboard. |
static boolean |
isFormatting(char c)
Says whether or not the character is formatting. |
static boolean |
isPunc(String s)
Checks to see if the passed string is punctuation in the installed keyboard. |
static boolean |
isSanskritStack(org.thdl.tib.text.DuffCode dc)
Says whether or not this glyph involves a Sanskrit stack. |
static boolean |
isSanskritStack(int font,
int code)
Says whether or not this glyph involves a Sanskrit stack. |
static boolean |
isStack(org.thdl.tib.text.DuffCode dc)
Says whether or not this glyph involves a Tibetan stack. |
static boolean |
isStack(int font,
int code)
Says whether or not this glyph involves a Tibetan stack. |
static boolean |
isStackingMedial()
Returns true iff stacking is medial. |
static boolean |
isTMWFontCharBreakable(char ch)
Returns true if and only if ch, which is an ASCII character that you can think of as an arbitrary index into one of the Tibetan fonts, is a character that is appropriate for ending a line of Tibetan. |
static boolean |
isTopVowel(org.thdl.tib.text.DuffCode dc)
Returns true iff this glyph is a top (superscript) vowel. |
static boolean |
isVowel(String s)
Checks to see if the passed string is a vowel in the installed keyboard. |
static boolean |
isWylieChar(String s)
Checks to see if the passed string is a character in Extended Wylie. |
static boolean |
isWylieFarRight(String s)
Returns true iff this Wylie is valid as a leftmost character in a Tibetan syllable. |
static boolean |
isWylieLeft(String s)
Returns true iff this Wylie is valid as a leftmost character in a Tibetan syllable. |
static boolean |
isWyliePunc(String s)
This method checks to see if the passed string is punctuation in Extended Wylie. |
static boolean |
isWylieRight(String s)
Returns true iff this Wylie is valid as a right (post-vowel) character in a Tibetan syllable. |
static boolean |
isWylieVowel(String s)
Checks to see if the passed string is a vowel in Extended Wylie. |
static boolean |
setKeyboard(org.thdl.tib.text.TibetanKeyboard kb)
(Re-)sets the keyboard. |
static boolean |
setKeyboard(URL url)
(Re-)sets the keyboard. |
static String |
wylieForGlyph(String hashKey)
Gets the Extended Wylie for a given hash key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String[] tmFontNames
public static final String[] tmwFontNames
public static final char BINDU
public static final char TSHEG
public static final char SPACE
public static final char WYLIE_SANSKRIT_STACKING_KEY
public static final char WYLIE_DISAMBIGUATING_KEY
public static final String WYLIE_aVOWEL
public static final String ACHUNG
public static final String ACHEN
public static final String i_VOWEL
public static final String u_VOWEL
public static final String e_VOWEL
public static final String o_VOWEL
public static final String ai_VOWEL
public static final String au_VOWEL
public static final String A_VOWEL
public static final String reverse_i_VOWEL
public static final String I_VOWEL
public static final String U_VOWEL
public static final String reverse_I_VOWEL
public static final int TM
public static final int REDUCED_C
public static final int TMW
public static final int VOWEL_i
public static final int VOWEL_u
public static final int VOWEL_e
public static final int VOWEL_o
public static final int VOWEL_A
public static final int VOWEL_U
public static final int UNICODE
public static final int HALF_C
Constructor Detail |
public TibetanMachineWeb()
Method Detail |
public static boolean setKeyboard(org.thdl.tib.text.TibetanKeyboard kb)
kb
- the keyboard to be installed. If null, then the
Extended Wylie keyboard is installed
public static boolean setKeyboard(URL url)
url
- the URL of the keyboard to be installed.
If null, then the Extended Wylie keyboard is
installed
public static SimpleAttributeSet getAttributeSet(int font)
TibetanDocument
.
font
- the number of the TibetanMachineWeb font for which
you want the SimpleAttributeSet: TibetanMachineWeb = 1,
TibetanMachineWeb1 = 2, TibetanMachineWeb = 3, etc. up to 10
public static boolean isFormatting(char c)
c
- the character to be checked
public static boolean isChar(String s)
s
- the string you want to check
public static boolean isWylieChar(String s)
s
- the string to be checked
public static boolean isPunc(String s)
s
- the string you want to check
public static boolean isWyliePunc(String s)
s
- the string to be checked
public static boolean isVowel(String s)
s
- the string you want to check
public static boolean isWylieVowel(String s)
s
- the string to be checked
public static boolean isWylieLeft(String s)
s
- the (Wylie) string to be checked
public static boolean isWylieRight(String s)
s
- the (Wylie) string to be checked
public static boolean isWylieFarRight(String s)
s
- the string to be checked
public static String getWylieForChar(String s)
s
- the string to be converted
TibetanKeyboard
public static boolean currentKeyboardIsExtendedWylie()
public static org.thdl.tib.text.TibetanKeyboard getKeyboard()
public static String getWylieForPunc(String s)
s
- the string to be converted
TibetanKeyboard
public static String getWylieForVowel(String s)
s
- the string to be converted
TibetanKeyboard
public static org.thdl.tib.text.DuffCode getVowel(String hashKey, int vowel)
hashKey
- the key for the character the
vowel is to be affixed tovowel
- the vowel you want the DuffCode for
DuffCode
public static boolean hasGlyph(String hashKey)
hashKey
- the key to be checked
public static org.thdl.tib.text.DuffCode getGlyph(String hashKey)
hashKey
- the key for which you want a DuffCode
DuffCode
public static org.thdl.tib.text.DuffCode getHalfHeightGlyph(String hashKey)
hashKey
- the key you want a half height glyph for
DuffCode
public static int getTMWFontNumber(String name)
name
- a font name
public static String getHashKeyForGlyph(int font, int code)
font
- a TibetanMachineWeb font numbercode
- an ASCII character code
public static String getHashKeyForGlyph(org.thdl.tib.text.DuffCode dc)
dc
- a DuffCode denoting a TibetanMachineWeb glyph
public static String wylieForGlyph(String hashKey)
hashKey
- the hash key for a glyph
public static String getWylieForGlyph(int font, int code)
font
- the font of the TibetanMachineWeb
glyph you want the Wylie ofcode
- the TibetanMachineWeb glyph
you want the Wylie of
public static String getWylieForGlyph(org.thdl.tib.text.DuffCode dc)
dc
- the DuffCode of the glyph you want
the Wylie of
public static boolean hasInputPrefix(String s)
public static boolean isSanskritStack(int font, int code)
font
- the font of a TibetanMachineWeb glyphcode
- the ASCII value of a TibetanMachineWeb glyph
public static boolean isSanskritStack(org.thdl.tib.text.DuffCode dc)
dc
- the DuffCode of a TibetanMachineWeb glyph
public static boolean isStack(int font, int code)
font
- the font of a TibetanMachineWeb glyphcode
- the ASCII value of a TibetanMachineWeb glyph
public static boolean isStack(org.thdl.tib.text.DuffCode dc)
dc
- the DuffCode of a TibetanMachineWeb glyph
public static Map getTibHash()
public static Map getBinduMap()
public static boolean hasDisambiguatingKey()
TibetanKeyboard
public static char getDisambiguatingKey()
TibetanKeyboard
public static boolean hasSanskritStackingKey()
TibetanKeyboard
public static boolean hasTibetanStackingKey()
TibetanKeyboard
public static boolean isStackingMedial()
TibetanKeyboard
public static char getStackingKey()
TibetanKeyboard
public static boolean isAChenRequiredBeforeVowel()
TibetanKeyboard
public static boolean isAChungConsonant()
TibetanKeyboard
public static boolean hasAVowel()
TibetanKeyboard
public static String getAVowel()
TibetanKeyboard
public static boolean isTopVowel(org.thdl.tib.text.DuffCode dc)
public static boolean isTMWFontCharBreakable(char ch)
'-'
, for example, represents
the tsheg (the little dot after a syllable) in (FIXME: Edward,
is this true?) all of the TMW fonts. Thus, this would return
true for '-'
.
Note that ch is not the Wylie transliteration; it is an
arbitrary character (well, not quite, since ' ', '\t', '\n' et
cetera seem to have been wisely chosen to represent Tibetan
whitespace, but pretty arbitrary). If you open up MS Word,
select TibetanMachineWeb1, and type a hyphen,
i.e. '-'
, you'll see a tsheg appear. If you open
Jskad and type a hyphen, you won't see a tsheg.
ch
- the ASCII character "index" into the TMW font
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |