com.code972.hebmorph.HebrewCharacters Maven / Gradle / Ivy
/***************************************************************************
* Copyright (C) 2010-2015 by *
* Itamar Syn-Hershko *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License *
* version 3, as published by the Free Software Foundation. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public *
* License along with this program; if not, see *
* . *
**************************************************************************/
package com.code972.hebmorph;
import java.util.HashMap;
/**
* Hebrew language constants
*
* @author synhershko
*/
public final class HebrewCharacters {
// Letters
public static char ALEPH = '\u05D0';
public static char BET = '\u05D1';
public static char GIMMEL = '\u05D2';
public static char DALET = '\u05D3';
public static char HE = '\u05D4';
public static char VAV = '\u05D5';
public static char ZAYIN = '\u05D6';
public static char HET = '\u05D7';
public static char TET = '\u05D8';
public static char YOD = '\u05D9';
public static char KAF_FINAL = '\u05DA';
public static char KAF = '\u05DB';
public static char LAMED = '\u05DC';
public static char MEM_FINAL = '\u05DD';
public static char MEM = '\u05DE';
public static char NUN_FINAL = '\u05DF';
public static char NUN = '\u05E0';
public static char SAMEKH = '\u05E1';
public static char AYIN = '\u05E2';
public static char PE_FINAL = '\u05E3';
public static char PE = '\u05E4';
public static char TSADI = '\u05E5';
public static char TSADI_FINAL = '\u05E6';
public static char QUF = '\u05E7';
public static char RESH = '\u05E8';
public static char SHIN = '\u05E9';
public static char TAV = '\u05EA';
// Punctuation
public static char GERESH = '\u05F3';
public static char GERSHAYIM = '\u05F4';
private static HashMap alternateCharacters = new HashMap<>();
static{
alternateCharacters.put('\uFB20', AYIN);
alternateCharacters.put('\uFB21', ALEPH);
alternateCharacters.put('\uFB22', DALET);
alternateCharacters.put('\uFB23', HE);
alternateCharacters.put('\uFB24', KAF);
alternateCharacters.put('\uFB25', LAMED);
alternateCharacters.put('\uFB26', MEM_FINAL);
alternateCharacters.put('\uFB27', RESH);
alternateCharacters.put('\uFB28', TAV);
}
public static char collapseAlternate(char ch){
if (alternateCharacters.containsKey(ch)){
return alternateCharacters.get(ch);
}
return ch;
}
}