Android Open Source - brainrot Language Utils






From Project

Back to project page brainrot.

License

The source code is released under:

Apache License

If you think the Android project brainrot listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package jcuenod.brainrot;
/*from   w  w w .  j a va2  s  .co  m*/
import java.text.Normalizer;
import java.text.Normalizer.Form;
import java.util.HashMap;
import java.util.Map;

import android.util.Log;

public class LanguageUtils {
  private static String LOG_TAG = "BrainRot LangU";
  
  public static String normalize (String denormalised)
  {
    return Normalizer.normalize(denormalised, Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
  }
  public static String transliterate (String unicodeStr)
  {
    String ret = unicodeStr;
      for (Map.Entry<String, String> entry : getTransliterationHash().entrySet()) {
        ret = ret.replace(entry.getKey(), entry.getValue());
      }
    return ret;
  }
  public static String domagic (String denormalised)
  {
    return LanguageUtils.transliterate(LanguageUtils.normalize(denormalised));
  }
  
  private static Map<String, String> getTransliterationHash()
  {
    Map<String, String> hash = new HashMap<String, String>();
    hash.put("?", "a");
    hash.put("?", "b");
    hash.put("?", "g");
    hash.put("?", "d");
    hash.put("?", "e");
    hash.put("?", "z");
    hash.put("?", "e");
    hash.put("?", "th");
    hash.put("?", "i");
    hash.put("?", "k");
    hash.put("?", "l");
    hash.put("?", "m");
    hash.put("?", "n");
    hash.put("?", "x");
    hash.put("?", "o");
    hash.put("?", "p");
    hash.put("??", "r");
    hash.put("?", "s");
    hash.put("?", "s");
    hash.put("?", "t");
    hash.put("?", "u");
    hash.put("?", "ph");
    hash.put("?", "ch");
    hash.put("?", "ps");
    hash.put("?", "o");

    hash.put("?", "a");
    hash.put("?", "b");
    hash.put("?", "g");
    hash.put("?", "d");
    hash.put("?", "e");
    hash.put("?", "z");
    hash.put("?", "e");
    hash.put("?", "th");
    hash.put("?", "i");
    hash.put("?", "k");
    hash.put("?", "l");
    hash.put("?", "m");
    hash.put("??", "n");
    hash.put("?", "x");
    hash.put("?", "o");
    hash.put("?", "p");
    hash.put("?", "r");
    hash.put("?", "s");
    hash.put("?", "s");
    hash.put("?", "t");
    hash.put("?", "u");
    hash.put("?", "ph");
    hash.put("?", "ch");
    hash.put("?", "ps");
    hash.put("?", "o");
    return hash;
  }
}




Java Source Code List

com.ipaulpro.afilechooser.FileChooserActivity.java
com.ipaulpro.afilechooser.FileListAdapter.java
com.ipaulpro.afilechooser.FileListFragment.java
com.ipaulpro.afilechooser.FileLoader.java
com.ipaulpro.afilechooser.utils.FileUtils.java
com.ipaulpro.afilechooser.utils.MimeTypeParser.java
com.ipaulpro.afilechooser.utils.MimeTypes.java
jcuenod.brainrot.BubbleChartDetails.java
jcuenod.brainrot.DBHelper.java
jcuenod.brainrot.DueCardBroadcastReceiver.java
jcuenod.brainrot.FlashCard.java
jcuenod.brainrot.ImportAsyncTask.java
jcuenod.brainrot.LanguageUtils.java
jcuenod.brainrot.MainActivity.java
jcuenod.brainrot.PieChartDetails.java
jcuenod.brainrot.ServiceStarter.java
jcuenod.brainrot.Statistics.java