001: /*
002: * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: /*
027: * (C) Copyright IBM Corp. 2000 - All Rights Reserved
028: *
029: * The original version of this source code and documentation is
030: * copyrighted and owned by IBM. These materials are provided
031: * under terms of a License Agreement between IBM and Sun.
032: * This technology is protected by multiple US and International
033: * patents. This notice and attribution to IBM may not be removed.
034: *
035: */
036:
037: package com.sun.inputmethods.internal.indicim;
038:
039: class DevanagariTables {
040:
041: static final char[] keyboardMap = {
042: /* 00 */'\u0000',
043: /* 01 */'\u0001',
044: /* 02 */'\u0002',
045: /* 03 */'\u0003',
046: /* 04 */'\u0004',
047: /* 05 */'\u0005',
048: /* 06 */'\u0006',
049: /* 07 */'\u0007',
050: /* 08 */'\u0008',
051: /* 09 */'\u0009',
052: /* 0A */'\012',
053: /* 0B */'\u000B',
054: /* 0C */'\u000C',
055: /* 0D */'\015',
056: /* 0E */'\u000E',
057: /* 0F */'\u000F',
058: /* 10 */'\u0010',
059: /* 11 */'\u0011',
060: /* 12 */'\u0012',
061: /* 13 */'\u0013',
062: /* 14 */'\u0014',
063: /* 15 */'\u0015',
064: /* 16 */'\u0016',
065: /* 17 */'\u0017',
066: /* 18 */'\u0018',
067: /* 19 */'\u0019',
068: /* 1A */'\u001A',
069: /* 1B */'\u001B',
070: /* 1C */'\u001C',
071: /* 1D */'\u001D',
072: /* 1E */'\u001E',
073: /* 1F */'\u001F',
074: /* 20 */'\u0020',
075: /* 21 */'\u090D', // '!'
076: /* 22 */'\u0920', // '"'
077: /* 23 */'\uFF00', // '#'
078: /* 24 */'\uFF01', // '$'
079: /* 25 */'\uFF02', // '%'
080: /* 26 */'\uFF04', // '&'
081: /* 27 */'\u091F', // '''
082: /* 28 */'\u0028', // '('
083: /* 29 */'\u0029', // ')'
084: /* 2A */'\uFF05', // '*'
085: /* 2B */'\u090B', // '+'
086: /* 2C */'\u002C', // ','
087: /* 2D */'\u002D', // '-'
088: /* 2E */'\u002E', // '.'
089: /* 2F */'\u092F', // '/'
090: /* 30 */'\u0966', // '0'
091: /* 31 */'\u0967', // '1'
092: /* 32 */'\u0968', // '2'
093: /* 33 */'\u0969', // '3'
094: /* 34 */'\u096A', // '4'
095: /* 35 */'\u096B', // '5'
096: /* 36 */'\u096C', // '6'
097: /* 37 */'\u096D', // '7'
098: /* 38 */'\u096E', // '8'
099: /* 39 */'\u096F', // '9'
100: /* 3A */'\u091B', // ':'
101: /* 3B */'\u091A', // ';'
102: /* 3C */'\u0937', // '<'
103: /* 3D */'\u0943', // '='
104: /* 3E */'\u0964', // '>'
105: /* 3F */'\u095F', // '?'
106: /* 40 */'\u0945', // '@'
107: /* 41 */'\u0913', // 'A'
108: /* 42 */'\u0934', // 'B'
109: /* 43 */'\u0923', // 'C'
110: /* 44 */'\u0905', // 'D'
111: /* 45 */'\u0906', // 'E'
112: /* 46 */'\u0907', // 'F'
113: /* 47 */'\u0909', // 'G'
114: /* 48 */'\u092B', // 'H'
115: /* 49 */'\u0918', // 'I'
116: /* 4A */'\u0931', // 'J'
117: /* 4B */'\u0916', // 'K'
118: /* 4C */'\u0925', // 'L'
119: /* 4D */'\u0936', // 'M'
120: /* 4E */'\u0933', // 'N'
121: /* 4F */'\u0927', // 'O'
122: /* 50 */'\u091D', // 'P'
123: /* 51 */'\u0914', // 'Q'
124: /* 52 */'\u0908', // 'R'
125: /* 53 */'\u090F', // 'S'
126: /* 54 */'\u090A', // 'T'
127: /* 55 */'\u0919', // 'U'
128: /* 56 */'\u0929', // 'V'
129: /* 57 */'\u0910', // 'W'
130: /* 58 */'\u0901', // 'X'
131: /* 59 */'\u092D', // 'Y'
132: /* 5A */'\u090E', // 'Z'
133: /* 5B */'\u0921', // '['
134: /* 5C */'\u0949', // '\'
135: /* 5D */'\u093C', // ']'
136: /* 5E */'\uFF03', // '^'
137: /* 5F */'\u0903', // '_'
138: /* 60 */'\u094A', // '`'
139: /* 61 */'\u094B', // 'a'
140: /* 62 */'\u0935', // 'b'
141: /* 63 */'\u092E', // 'c'
142: /* 64 */'\u094D', // 'd'
143: /* 65 */'\u093E', // 'e'
144: /* 66 */'\u093F', // 'f'
145: /* 67 */'\u0941', // 'g'
146: /* 68 */'\u092A', // 'h'
147: /* 69 */'\u0917', // 'i'
148: /* 6A */'\u0930', // 'j'
149: /* 6B */'\u0915', // 'k'
150: /* 6C */'\u0924', // 'l'
151: /* 6D */'\u0938', // 'm'
152: /* 6E */'\u0932', // 'n'
153: /* 6F */'\u0926', // 'o'
154: /* 70 */'\u091C', // 'p'
155: /* 71 */'\u094C', // 'q'
156: /* 72 */'\u0940', // 'r'
157: /* 73 */'\u0947', // 's'
158: /* 74 */'\u0942', // 't'
159: /* 75 */'\u0939', // 'u'
160: /* 76 */'\u0928', // 'v'
161: /* 77 */'\u0948', // 'w'
162: /* 78 */'\u0902', // 'x'
163: /* 79 */'\u092C', // 'y'
164: /* 7A */'\u0946', // 'z'
165: /* 7B */'\u0922', // '{'
166: /* 7C */'\u0911', // '|'
167: /* 7D */'\u091E', // '}'
168: /* 7E */'\u0912', // '~'
169: /* 7F */'\u007F' //
170: };
171:
172: // the character substitutions for the meta characters.
173: static final char[] RA_SUB = { '\u094D', '\u0930' };
174: static final char[] RA_SUP = { '\u0930', '\u094D' };
175: static final char[] CONJ_JA_NYA = { '\u091C', '\u094D', '\u091E' };
176: static final char[] CONJ_TA_RA = { '\u0924', '\u094D', '\u0930' };
177: static final char[] CONJ_KA_SSA = { '\u0915', '\u094D', '\u0937' };
178: static final char[] CONJ_SHA_RA = { '\u0936', '\u094D', '\u0930' };
179:
180: static final char[][] substitutionTable = { RA_SUB, RA_SUP,
181: CONJ_JA_NYA, CONJ_TA_RA, CONJ_KA_SSA, CONJ_SHA_RA };
182:
183: // The following characters followed by Nukta should be replaced
184: // by the corresponding character as defined in ISCII91
185: static final char SIGN_CANDRABINDU = '\u0901';
186: static final char LETTER_I = '\u0907';
187: static final char LETTER_II = '\u0908';
188: static final char LETTER_VOCALIC_R = '\u090B';
189: static final char LETTER_KA = '\u0915';
190: static final char LETTER_KHA = '\u0916';
191: static final char LETTER_GA = '\u0917';
192: static final char LETTER_JA = '\u091C';
193: static final char LETTER_DDA = '\u0921';
194: static final char LETTER_DDHA = '\u0922';
195: static final char LETTER_PHA = '\u092B';
196: static final char VOWEL_SIGN_I = '\u093F';
197: static final char VOWEL_SIGN_II = '\u0940';
198: static final char VOWEL_SIGN_VOCALIC_R = '\u0943';
199: static final char DANDA = '\u0964';
200:
201: // The follwing characters replace the above characters followed by Nukta. These
202: // are defined in one to one correspondence order.
203: static final char SIGN_OM = '\u0950';
204: static final char LETTER_VOCALIC_L = '\u090C';
205: static final char LETTER_VOCALIC_LL = '\u0961';
206: static final char LETTER_VOCALIC_RR = '\u0960';
207: static final char LETTER_QA = '\u0958';
208: static final char LETTER_KHHA = '\u0959';
209: static final char LETTER_GHHA = '\u095A';
210: static final char LETTER_ZA = '\u095B';
211: static final char LETTER_DDDHA = '\u095C';
212: static final char LETTER_RHA = '\u095D';
213: static final char LETTER_FA = '\u095E';
214: static final char VOWEL_SIGN_VOCALIC_L = '\u0962';
215: static final char VOWEL_SIGN_VOCALIC_LL = '\u0963';
216: static final char VOWEL_SIGN_VOCALIC_RR = '\u0944';
217: static final char SIGN_AVAGRAHA = '\u093D';
218:
219: static final char[] joinWithNukta = { SIGN_CANDRABINDU, LETTER_I,
220: LETTER_II, LETTER_VOCALIC_R, LETTER_KA, LETTER_KHA,
221: LETTER_GA, LETTER_JA, LETTER_DDA, LETTER_DDHA, LETTER_PHA,
222: VOWEL_SIGN_I, VOWEL_SIGN_II, VOWEL_SIGN_VOCALIC_R, DANDA };
223:
224: static final char[] nuktaForm = { SIGN_OM, LETTER_VOCALIC_L,
225: LETTER_VOCALIC_LL, LETTER_VOCALIC_RR, LETTER_QA,
226: LETTER_KHHA, LETTER_GHHA, LETTER_ZA, LETTER_DDDHA,
227: LETTER_RHA, LETTER_FA, VOWEL_SIGN_VOCALIC_L,
228: VOWEL_SIGN_VOCALIC_LL, VOWEL_SIGN_VOCALIC_RR, SIGN_AVAGRAHA };
229: }
|