|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkr.ac.kaist.swrc.jhannanum.share.Code
public class Code
This class is for code conversion. HanNanum internally uses triple encoding, which represents an Korean eumjeol with three characters - CHOSEONG(beginning consonant), JUNGSEONG(vowel), JONGSEONG(final consonant). This class converts the Korean encoding from unicode to triple encoding, and vice versa.
Field Summary | |
---|---|
private static char[] |
CHOSEONG_LIST
the list of CHOSEONG - beginning consonant |
private static byte[] |
CHOSEONG_LIST_REV
the list of JONGSEONG for reverse |
static int |
ENCODING_TRIPLE
triple encoding |
static int |
ENCODING_UNICODE
unicode |
static char |
HANGUL_FILLER
hangul filler in unicode |
static int |
JAMO_CHOSEONG
CHOSEONG(beginning consonant) |
static int |
JAMO_JONGSEONG
JONGSEONG(final consonant) |
static int |
JAMO_JUNGSEONG
JUNGSEONG(vowel) |
private static char[] |
JONGSEONG_LIST
the list of JUNGSEONG - vowel |
private static byte[] |
JONGSEONG_LIST_REV
the list of JONGSEONG for reverse |
Constructor Summary | |
---|---|
Code()
|
Method Summary | |
---|---|
static void |
convertFile(java.lang.String srcFileName,
java.lang.String desFileName,
int srcEncoding,
int desEncoding)
It changes the encoding of text file between UTF-8 and the triple encoding. |
static boolean |
isChoseong(char c)
It checks whether the specified character is choseong. |
static boolean |
isJongseong(char c)
It checks whether the specified character is jongseong. |
static boolean |
isJungseong(char c)
It checks whether the specified character is jungseong. |
static char |
toChoseong(char jongseong)
It changes the specified jongseong to choseong. |
static char |
toCompatibilityJamo(char jamo)
Changes the unicode Hangul jamo to unicode compatibility Hangul jamo. |
static char |
toJamo(char jamo,
int flag)
It changes the unicode Hangul compatibility jamo to Hangul jamo - choseong, jungseong, or jongseong. |
static java.lang.String |
toString(char[] tripleArray)
Converts the encoding of the text from Hangul triple encoding to unicode. |
static java.lang.String |
toString(char[] tripleArray,
int len)
Converts the encoding of the text from Hangul triple encoding to unicode. |
static char |
toSyllable(char cho,
char jung,
char jong)
It combines the specified choseong, jungseong, and jongseong to one unicode Hangul syllable. |
static char[] |
toTripleArray(java.lang.String str)
It converts the encoding of the specified text from unicode to triple encoding. |
static java.lang.String |
toTripleString(java.lang.String str)
It returns the unicode representation of triple encoding text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ENCODING_TRIPLE
public static final int ENCODING_UNICODE
public static final int JAMO_CHOSEONG
public static final int JAMO_JUNGSEONG
public static final int JAMO_JONGSEONG
public static final char HANGUL_FILLER
private static final char[] CHOSEONG_LIST
private static final char[] JONGSEONG_LIST
private static final byte[] CHOSEONG_LIST_REV
private static final byte[] JONGSEONG_LIST_REV
Constructor Detail |
---|
public Code()
Method Detail |
---|
public static void convertFile(java.lang.String srcFileName, java.lang.String desFileName, int srcEncoding, int desEncoding) throws java.io.IOException
srcFileName
- - the input filedesFileName
- - the output filesrcEncoding
- - the encoding of input file: ENCODING_UNICODE or ENCODING_TRIPLEdesEncoding
- - the encoding of input file: ENCODING_UNICODE or ENCODING_TRIPLE
java.io.IOException
public static boolean isChoseong(char c)
c
- - the character to check
public static boolean isJongseong(char c)
c
- - the character to check
public static boolean isJungseong(char c)
c
- - the character to check
public static char toChoseong(char jongseong)
jongseong
- - the final consonant
public static char toCompatibilityJamo(char jamo)
jamo
- - unicode Hangul jamo
public static char toJamo(char jamo, int flag)
jamo
- - the unicode Hangul compatibility jamoflag
- - JAMO_CHOSEONG or JAMO_JUNGSEONG or JAMO_JONGSEONG
public static java.lang.String toString(char[] tripleArray)
tripleArray
- - the text with the Hangul triple encoding
public static java.lang.String toString(char[] tripleArray, int len)
tripleArray
- - the text with the Hangul triple encodinglen
- - the length of text to convert
public static char toSyllable(char cho, char jung, char jong)
cho
- - beginning consonantjung
- - voweljong
- - final consonant
public static char[] toTripleArray(java.lang.String str)
str
- - the unicode text
public static java.lang.String toTripleString(java.lang.String str)
str
- - the unicode text
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |