Created
March 18, 2021 00:26
-
-
Save Zelakolase/42d7098d94d5c9606d3ec9faa1e8020d to your computer and use it in GitHub Desktop.
لغة غريبة
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
public class main { | |
public static void main(String[] args) { | |
String in = "عملت كود عشان لغة غريبة بجافا"; | |
String[] in_arr = in.split("\\s+"); | |
String out = ""; | |
for(int i = 0;i<in_arr.length;i++) { | |
String word = in_arr[i]; | |
String letter = word.substring(0,1); | |
String modWord = word.replaceFirst(word.substring(0,1),"س"); | |
String finall = modWord+" "+dir.get(letter)+" "; | |
out += finall; | |
} | |
System.out.println(out); | |
} | |
static HashMap<String,String> dir = new HashMap<String,String>() { | |
{ | |
put("ا","ارنب"); | |
put("ب","بطاطس"); | |
put("ت","تحس"); | |
put("ج","جامد"); | |
put("ح","حرق"); | |
put("خ","خطير"); | |
put("د","دبانة"); | |
put("ر","رأي"); | |
put("ز","زمبيل"); | |
put("س","سقراط"); | |
put("ش","شباك"); | |
put("ص","صبح"); | |
put("ض","ضرب"); | |
put("ط","طيارة"); | |
put("ع","عربية"); | |
put("غ","غسول"); | |
put("ف","فورتيكة"); | |
put("ق","قصدي"); | |
put("ك","كسبان"); | |
put("ل","لبوس"); | |
put("م","مستشيح"); | |
put("ن","نونو"); | |
put("ه","هحارب"); | |
put("و","وصل"); | |
put("ي","يعيش"); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment