public static String getBlacklist(SharedPreferences prefs, String languageCode) {
    if (languageCode.equals("afr")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_AFRIKAANS, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("sqi")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_ALBANIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("ara")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_ARABIC, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("aze")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_AZERI, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("eus")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_BASQUE, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("bel")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_BELARUSIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("ben")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_BENGALI, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("bul")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_BULGARIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("cat")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_CATALAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("chi_sim")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_CHINESE_SIMPLIFIED, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("chi_tra")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_CHINESE_TRADITIONAL, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("hrv")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_CROATIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("ces")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_CZECH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("dan")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_DANISH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("nld")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_DUTCH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("eng")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_ENGLISH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("est")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_ESTONIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("fin")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_FINNISH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("fra")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_FRENCH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("glg")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_GALICIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("deu")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_GERMAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("ell")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_GREEK, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("heb")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_HEBREW, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("hin")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_HINDI, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("hun")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_HUNGARIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("isl")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_ICELANDIC, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("ind")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_INDONESIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("ita")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_ITALIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("jpn")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_JAPANESE, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("kan")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_KANNADA, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("kor")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_KOREAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("lav")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_LATVIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("lit")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_LITHUANIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("mkd")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_MACEDONIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("msa")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_MALAY, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("mal")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_MALAYALAM, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("mlt")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_MALTESE, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("nor")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_NORWEGIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("pol")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_POLISH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("por")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_PORTUGUESE, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("ron")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_ROMANIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("rus")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_RUSSIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("srp")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_SERBIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("slk")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_SLOVAK, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("slv")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_SLOVENIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("spa")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_SPANISH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("swa")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_SWAHILI, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("swe")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_SWEDISH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("tgl")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_TAGALOG, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("tam")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_TAMIL, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("tel")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_TELUGU, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("tha")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_THAI, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("tur")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_TURKISH, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("ukr")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_UKRAINIAN, getDefaultBlacklist(languageCode)); }
    else if (languageCode.equals("vie")) { return prefs.getString(KEY_CHARACTER_BLACKLIST_VIETNAMESE, getDefaultBlacklist(languageCode)); }
    else {
      throw new IllegalArgumentException();
    }    
  }
Helper class to enable language-specific character blacklists/whitelists.
OCRTest/src/main/java/edu/sfsu/cs/orange/ocr/OcrCharacterHelper.java