Changeset 241
- Timestamp:
- 01/02/08 20:11:30 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lex/trunk/src/com/qwirx/lex/hebrew/HebrewConverter.java
r236 r241 67 67 for (int i = 0; i < input.length(); i++) 68 68 { 69 String substr = input.substring(i); 70 69 71 char c = input.charAt(i); 70 String substr = input.substring(i);71 72 72 char c2 = 0xffff; 73 73 if (i < input.length() - 1) … … 94 94 else if (c == 'A') { output.append("\u05b7"); } // Patah 95 95 else if (c == 'B') { output.append("\u05d1"); } // Bet 96 else if (c == 'C') { output.append("\u05e9 "); } // 05c1// Shin, Shin Dot96 else if (c == 'C') { output.append("\u05e9\u05c1"); } // Shin, Shin Dot 97 97 else if (c == '#') { output.append("\u05e9"); } // S/hin with no dot 98 98 else if (c == 'D') { output.append("\u05d3"); } // Dalet 99 99 else if (c == 'E') { output.append("\u05b6"); } // Segol 100 else if (c == 'F') { output.append("\u05e9 "); } // 05c2// Shin, Sin Dot100 else if (c == 'F') { output.append("\u05e9\u05c2"); } // Shin, Sin Dot 101 101 else if (c == 'G') { output.append("\u05d2"); } // Gimel 102 102 else if (c == 'H') { output.append("\u05d4"); } // He … … 126 126 127 127 // Cantillation Marks/Punctuation ala MC 128 128 // removed at Nicolai's request 2/1/08 129 /* 129 130 else if (c == '0') 130 131 { … … 171 172 } 172 173 174 else if (c == '5') 175 { 176 i++; 177 if (c2 == '2') { output.append("\u05c4"); } // Puncta Extraordinaria above (not a revia!) 178 else if (c2 == '3') { output.append("\u0323"); } // Puncta Extraordinaria below; Ps 27:13 only 179 else { throw new IllegalArgumentException(substr); } 180 } 181 173 182 else if (c == '6') 174 183 { … … 216 225 else if (c2 == '5') { output.append("\u05bd"); } // meteg, silluq (right) 217 226 else { throw new IllegalArgumentException(substr); } 227 }*/ 228 229 else if (c >= '0' && c <= '9' && c2 >= '0' && c2 <= '9') 230 { 231 i++; // skip both 218 232 } 219 233 … … 228 242 229 243 // Other 230 231 else if (c == '5')232 {233 i++;234 if (c2 == '2') { output.append("\u05c4"); } // Puncta Extraordinaria above (not a revia!)235 else if (c2 == '3') { output.append("\u0323"); } // Puncta Extraordinaria below; Ps 27:13 only236 else { throw new IllegalArgumentException(substr); }237 }238 244 239 245 else if (c == '*') { /* 0 */ } // asterisk indicates Qere/Ketiv … … 258 264 public static String toTranslit(String input) 259 265 { 266 input = input.toUpperCase().replaceAll("\\d\\d", ""); 260 267 StringBuffer output = new StringBuffer(); 261 268 262 input = input.replaceAll("\\d\\d", "").toUpperCase();263 264 269 for (int i = 0; i < input.length(); i++) 265 270 { 266 271 String substr = input.substring(i); 267 272 char c = input.charAt(i); 268 273 char c2 = 0xffff; 274 if (i < input.length() - 1) 275 { 276 c2 = input.charAt(i + 1); 277 } 278 269 279 if (substr.matches("[BGDKPT]\\.[@AEIOUW;:].*")) 270 280 { … … 272 282 i++; // skip the dagesh (.) 273 283 } 274 else if (substr.matches("[BCDFGJKLMNPQSTVWYZ ]\\..*"))284 else if (substr.matches("[BCDFGJKLMNPQSTVWYZ#]\\..*")) 275 285 { 276 286 if (c == 'C') { output.append("šš"); } 277 287 else if (c == 'F') { output.append("ÅÅ"); } 288 else if (c == '#') { output.append("ss"); } // ?? guess ?? 278 289 else if (c == 'J') { output.append("yy"); } 279 290 else if (c == 'V') { output.append("ťť"); } … … 297 308 else if (c == 'F') { output.append("Å"); } 298 309 else if (c == 'C') { output.append("Å¡"); } 310 else if (c == '#') { output.append("s"); } // ?? guess ?? 299 311 else if (c == '@') { output.append("Ä"); } 300 312 else if (c == 'D' || c == 'G' || c == 'H' ||
