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 BengaliInputMethodDescriptor extends IndicIMDescriptor {
013: private static final Locale BENGALI = new Locale("bn", "IN");
014:
015: public BengaliInputMethodDescriptor() {
016: super (BENGALI, "Bengali");
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 */'\u09A0', // '"'
062: /* 23 */'\uFF00', // '#'
063: /* 24 */'\uFF01', // '$'
064: /* 25 */'\uFF02', // '%'
065: /* 26 */'\uFF04', // '&'
066: /* 27 */'\u099F', // '''
067: /* 28 */'\u0028', // '('
068: /* 29 */'\u0029', // ')'
069: /* 2A */'\uFF05', // '*'
070: /* 2B */'\u098B', // '+'
071: /* 2C */'\u002C', // ','
072: /* 2D */'\u002D', // '-'
073: /* 2E */'\u002E', // '.'
074: /* 2F */'\u09DF', // '/'
075: /* 30 */'\u09E6', // '0'
076: /* 31 */'\u09E7', // '1'
077: /* 32 */'\u09E8', // '2'
078: /* 33 */'\u09E9', // '3'
079: /* 34 */'\u09EA', // '4'
080: /* 35 */'\u09EB', // '5'
081: /* 36 */'\u09EC', // '6'
082: /* 37 */'\u09ED', // '7'
083: /* 38 */'\u09EE', // '8'
084: /* 39 */'\u09EF', // '9'
085: /* 3A */'\u099B', // ':'
086: /* 3B */'\u099A', // ';'
087: /* 3C */'\u09B7', // '<'
088: /* 3D */'\u09C3', // '='
089: /* 3E */'\u0964', // '>' (Devanagari danda)
090: /* 3F */'\u09AF', // '?'
091: /* 40 */'\uFFFF', // '@'
092: /* 41 */'\u0993', // 'A'
093: /* 42 */'\uFFFF', // 'B'
094: /* 43 */'\u09A3', // 'C'
095: /* 44 */'\u0985', // 'D'
096: /* 45 */'\u0986', // 'E'
097: /* 46 */'\u0987', // 'F'
098: /* 47 */'\u0989', // 'G'
099: /* 48 */'\u09AB', // 'H'
100: /* 49 */'\u0998', // 'I'
101: /* 4A */'\uFFFF', // 'J'
102: /* 4B */'\u0996', // 'K'
103: /* 4C */'\u09A5', // 'L'
104: /* 4D */'\u09B6', // 'M'
105: /* 4E */'\uFFFF', // 'N'
106: /* 4F */'\u09A7', // 'O'
107: /* 50 */'\u099D', // 'P'
108: /* 51 */'\u0994', // 'Q'
109: /* 52 */'\u0988', // 'R'
110: /* 53 */'\u098F', // 'S'
111: /* 54 */'\u098A', // 'T'
112: /* 55 */'\u0999', // 'U'
113: /* 56 */'\uFFFF', // 'V'
114: /* 57 */'\u0990', // 'W'
115: /* 58 */'\u0981', // 'X'
116: /* 59 */'\u09AD', // 'Y'
117: /* 5A */'\uFFFF', // 'Z'
118: /* 5B */'\u09A1', // '['
119: /* 5C */'\uFFFF', // '\'
120: /* 5D */'\u09BC', // ']'
121: /* 5E */'\uFF03', // '^'
122: /* 5F */'\u0983', // '_'
123: /* 60 */'\uFFFF', // '`'
124: /* 61 */'\u09CB', // 'a'
125: /* 62 */'\u09AC', // 'b' (this is a BA instead of a VA)
126: /* 63 */'\u09AE', // 'c'
127: /* 64 */'\u09CD', // 'd'
128: /* 65 */'\u09BE', // 'e'
129: /* 66 */'\u09BF', // 'f'
130: /* 67 */'\u09C1', // 'g'
131: /* 68 */'\u09AA', // 'h'
132: /* 69 */'\u0997', // 'i'
133: /* 6A */'\u09B0', // 'j'
134: /* 6B */'\u0995', // 'k'
135: /* 6C */'\u09A4', // 'l'
136: /* 6D */'\u09B8', // 'm'
137: /* 6E */'\u09B2', // 'n'
138: /* 6F */'\u09A6', // 'o'
139: /* 70 */'\u099C', // 'p'
140: /* 71 */'\u09CC', // 'q'
141: /* 72 */'\u09C0', // 'r'
142: /* 73 */'\u09C7', // 's'
143: /* 74 */'\u09C2', // 't'
144: /* 75 */'\u09B9', // 'u'
145: /* 76 */'\u09A8', // 'v'
146: /* 77 */'\u09C8', // 'w'
147: /* 78 */'\u0982', // 'x'
148: /* 79 */'\u09AC', // 'y' (this is also a BA...)
149: /* 7A */'\uFFFF', // 'z'
150: /* 7B */'\u09A2', // '{'
151: /* 7C */'\uFFFF', // '|'
152: /* 7D */'\u099E', // '}'
153: /* 7E */'\uFFFF', // '~'
154: /* 7F */'\u007F' // ''
155: };
156:
157: char[] RA_SUB = { '\u09CD', '\u09B0' };
158: char[] RA_SUP = { '\u09B0', '\u09CD' };
159: char[] CONJ_JA_NYA = { '\u099C', '\u09CD', '\u099E' };
160: char[] CONJ_TA_RA = { '\u09A4', '\u09CD', '\u09B0' };
161: char[] CONJ_KA_SSA = { '\u0995', '\u09CD', '\u09B7' };
162: char[] CONJ_SHA_RA = { '\u09B6', '\u09CD', '\u09B0' };
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 = '\u0987';
170: char LETTER_II = '\u0988';
171: char LETTER_VOCALIC_R = '\u098B';
172: char LETTER_DDA = '\u09A1';
173: char LETTER_DDHA = '\u09A2';
174: char VOWEL_SIGN_I = '\u09BF';
175: char VOWEL_SIGN_II = '\u09C0';
176: char VOWEL_SIGN_VOCALIC_R = '\u09C3';
177:
178: // The following characters replace the above characters followed by Nukta. These
179: // are defined in one to one correspondence order.
180: char LETTER_VOCALIC_L = '\u098C';
181: char LETTER_VOCALIC_LL = '\u09E1';
182: char LETTER_VOCALIC_RR = '\u09E0';
183: char LETTER_DDDHA = '\u09DC';
184: char LETTER_RHA = '\u09DD';
185: char VOWEL_SIGN_VOCALIC_L = '\u09E2';
186: char VOWEL_SIGN_VOCALIC_LL = '\u09E3';
187: char VOWEL_SIGN_VOCALIC_RR = '\u09C4';
188:
189: joinWithNukta = new char[] { LETTER_I, LETTER_II,
190: LETTER_VOCALIC_R, LETTER_DDA, LETTER_DDHA,
191: VOWEL_SIGN_I, VOWEL_SIGN_II, VOWEL_SIGN_VOCALIC_R };
192:
193: nuktaForm = new char[] { LETTER_VOCALIC_L,
194: LETTER_VOCALIC_LL, LETTER_VOCALIC_RR, LETTER_DDDHA,
195: LETTER_RHA, VOWEL_SIGN_VOCALIC_L,
196: VOWEL_SIGN_VOCALIC_LL, VOWEL_SIGN_VOCALIC_RR };
197: }
198:
199: return new IndicInputMethodImpl(keyboardMap, joinWithNukta,
200: nuktaForm, substitutionTable);
201: }
202: }
|