001: /*
002: *******************************************************************************
003: * Copyright (C) 2000-2004, International Business Machines Corporation and *
004: * others. All Rights Reserved. *
005: *******************************************************************************
006: */
007:
008: package com.ibm.icu.dev.tool.ime.indic;
009:
010: import java.util.Locale;
011:
012: public class OriyaInputMethodDescriptor extends IndicIMDescriptor {
013: private static final Locale ORIYA = new Locale("or", "IN");
014:
015: public OriyaInputMethodDescriptor() {
016: super (ORIYA, "Oriya");
017: }
018:
019: private static char[] keyboardMap;
020: private static char[][] substitutionTable;
021: private static char[] joinWithNukta;
022: private static char[] nuktaForm;
023:
024: protected IndicInputMethodImpl getImpl() {
025: if (keyboardMap == null) {
026: keyboardMap = new char[] {
027: /* 00 */'\u0000',
028: /* 01 */'\u0001',
029: /* 02 */'\u0002',
030: /* 03 */'\u0003',
031: /* 04 */'\u0004',
032: /* 05 */'\u0005',
033: /* 06 */'\u0006',
034: /* 07 */'\u0007',
035: /* 08 */'\u0008',
036: /* 09 */'\u0009',
037: /* 0A */'\012',
038: /* 0B */'\u000B',
039: /* 0C */'\u000C',
040: /* 0D */'\015',
041: /* 0E */'\u000E',
042: /* 0F */'\u000F',
043: /* 10 */'\u0010',
044: /* 11 */'\u0011',
045: /* 12 */'\u0012',
046: /* 13 */'\u0013',
047: /* 14 */'\u0014',
048: /* 15 */'\u0015',
049: /* 16 */'\u0016',
050: /* 17 */'\u0017',
051: /* 18 */'\u0018',
052: /* 19 */'\u0019',
053: /* 1A */'\u001A',
054: /* 1B */'\u001B',
055: /* 1C */'\u001C',
056: /* 1D */'\u001D',
057: /* 1E */'\u001E',
058: /* 1F */'\u001F',
059: /* 20 */'\u0020',
060: /* 21 */'\uFFFF', // '!'
061: /* 22 */'\u0B20', // '"'
062: /* 23 */'\uFF00', // '#'
063: /* 24 */'\uFF01', // '$'
064: /* 25 */'\uFF02', // '%'
065: /* 26 */'\uFF04', // '&'
066: /* 27 */'\u0B1F', // '''
067: /* 28 */'\u0028', // '('
068: /* 29 */'\u0029', // ')'
069: /* 2A */'\uFF05', // '*'
070: /* 2B */'\u0B0B', // '+'
071: /* 2C */'\u002C', // ','
072: /* 2D */'\u002D', // '-'
073: /* 2E */'\u002E', // '.'
074: /* 2F */'\u0B5F', // '/'
075: /* 30 */'\u0B66', // '0'
076: /* 31 */'\u0B67', // '1'
077: /* 32 */'\u0B68', // '2'
078: /* 33 */'\u0B69', // '3'
079: /* 34 */'\u0B6A', // '4'
080: /* 35 */'\u0B6B', // '5'
081: /* 36 */'\u0B6C', // '6'
082: /* 37 */'\u0B6D', // '7'
083: /* 38 */'\u0B6E', // '8'
084: /* 39 */'\u0B6F', // '9'
085: /* 3A */'\u0B1B', // ':'
086: /* 3B */'\u0B1A', // ';'
087: /* 3C */'\u0B37', // '<'
088: /* 3D */'\u0B43', // '='
089: /* 3E */'\u0964', // '>' (Devanagari danda)
090: /* 3F */'\u0B2F', // '?'
091: /* 40 */'\uFFFF', // '@'
092: /* 41 */'\u0B13', // 'A'
093: /* 42 */'\uFFFF', // 'B'
094: /* 43 */'\u0B23', // 'C'
095: /* 44 */'\u0B05', // 'D'
096: /* 45 */'\u0B06', // 'E'
097: /* 46 */'\u0B07', // 'F'
098: /* 47 */'\u0B09', // 'G'
099: /* 48 */'\u0B2B', // 'H'
100: /* 49 */'\u0B18', // 'I'
101: /* 4A */'\uFFFF', // 'J'
102: /* 4B */'\u0B16', // 'K'
103: /* 4C */'\u0B25', // 'L'
104: /* 4D */'\u0B36', // 'M'
105: /* 4E */'\u0B33', // 'N'
106: /* 4F */'\u0B27', // 'O'
107: /* 50 */'\u0B1D', // 'P'
108: /* 51 */'\u0B14', // 'Q'
109: /* 52 */'\u0B08', // 'R'
110: /* 53 */'\u0B0F', // 'S'
111: /* 54 */'\u0B0A', // 'T'
112: /* 55 */'\u0B19', // 'U'
113: /* 56 */'\uFFFF', // 'V'
114: /* 57 */'\u0B10', // 'W'
115: /* 58 */'\u0B01', // 'X'
116: /* 59 */'\u0B2D', // 'Y'
117: /* 5A */'\uFFFF', // 'Z'
118: /* 5B */'\u0B21', // '['
119: /* 5C */'\uFFFF', // '\'
120: /* 5D */'\u0B3C', // ']'
121: /* 5E */'\uFF03', // '^'
122: /* 5F */'\u0B03', // '_'
123: /* 60 */'\uFFFF', // '`'
124: /* 61 */'\u0B4B', // 'a'
125: /* 62 */'\u0B2C', // 'b' (va, but no Unicode code point, used ba instead)
126: /* 63 */'\u0B2E', // 'c'
127: /* 64 */'\u0B4D', // 'd'
128: /* 65 */'\u0B3E', // 'e'
129: /* 66 */'\u0B3F', // 'f'
130: /* 67 */'\u0B41', // 'g'
131: /* 68 */'\u0B2A', // 'h'
132: /* 69 */'\u0B17', // 'i'
133: /* 6A */'\u0B30', // 'j'
134: /* 6B */'\u0B15', // 'k'
135: /* 6C */'\u0B24', // 'l'
136: /* 6D */'\u0B38', // 'm'
137: /* 6E */'\u0B32', // 'n'
138: /* 6F */'\u0B26', // 'o'
139: /* 70 */'\u0B1C', // 'p'
140: /* 71 */'\u0B4C', // 'q'
141: /* 72 */'\u0B40', // 'r'
142: /* 73 */'\u0B47', // 's'
143: /* 74 */'\u0B42', // 't'
144: /* 75 */'\u0B39', // 'u'
145: /* 76 */'\u0B28', // 'v'
146: /* 77 */'\u0B48', // 'w'
147: /* 78 */'\u0B02', // 'x'
148: /* 79 */'\u0B2C', // 'y'
149: /* 7A */'\uFFFF', // 'z'
150: /* 7B */'\u0B22', // '{'
151: /* 7C */'\uFFFF', // '|'
152: /* 7D */'\u0B1E', // '}'
153: /* 7E */'\uFFFF', // '~'
154: /* 7F */'\u007F' // ''
155: };
156:
157: char[] RA_SUB = { '\u0B4D', '\u0B30' };
158: char[] RA_SUP = { '\u0B30', '\u0B4D' };
159: char[] CONJ_JA_NYA = { '\u0B1C', '\u0B4D', '\u0B1E' };
160: char[] CONJ_TA_RA = { '\u0B24', '\u0B4D', '\u0B30' };
161: char[] CONJ_KA_SSA = { '\u0B15', '\u0B4D', '\u0B37' };
162: char[] CONJ_SHA_RA = { '\u0B36', '\u0B4D', '\u0B30' };
163:
164: substitutionTable = new char[][] { RA_SUB, RA_SUP,
165: CONJ_JA_NYA, CONJ_TA_RA, CONJ_KA_SSA, CONJ_SHA_RA };
166:
167: // The following characters followed by Nukta should be replaced
168: // by the corresponding character as defined in ISCII91
169: char LETTER_I = '\u0B07';
170: char LETTER_II = '\u0B08';
171: char LETTER_VOCALIC_R = '\u0B0B';
172: char LETTER_DDA = '\u0B21';
173: char LETTER_DDHA = '\u0B22';
174: char VOWEL_SIGN_I = '\u0B3F';
175: char VOWEL_SIGN_II = '\u0B40';
176:
177: // The following characters replace the above characters followed by Nukta. These
178: // are defined in one to one correspondence order.
179: char LETTER_VOCALIC_L = '\u0B0C';
180: char LETTER_VOCALIC_LL = '\u0B61';
181: char LETTER_VOCALIC_RR = '\u0B60';
182: char LETTER_RRA = '\u0B5C';
183: char LETTER_RHA = '\u0B5D';
184: char VOWEL_SIGN_VOCALIC_L = '\u0B62';
185: char VOWEL_SIGN_VOCALIC_LL = '\u0B63';
186:
187: joinWithNukta = new char[] { LETTER_VOCALIC_R, LETTER_I,
188: LETTER_II, LETTER_DDA, LETTER_DDHA, VOWEL_SIGN_I,
189: VOWEL_SIGN_II };
190:
191: nuktaForm = new char[] { LETTER_VOCALIC_RR,
192: LETTER_VOCALIC_L, LETTER_VOCALIC_LL, LETTER_RRA,
193: LETTER_RHA, VOWEL_SIGN_VOCALIC_L,
194: VOWEL_SIGN_VOCALIC_LL };
195: }
196:
197: return new IndicInputMethodImpl(keyboardMap, joinWithNukta,
198: nuktaForm, substitutionTable);
199: }
200: }
|