fork(4) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.Scanner;
  5.  
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. Scanner sc = new Scanner(System.in);
  11. System.out.println("Translating phrase...");
  12. String phrase = sc.nextLine();
  13.  
  14. Map<String, String> m = getDictionary(false); // Translate Maren phrase to English
  15. //Map<String, String> m = getDictionary(); // Translate English phrase to Maren
  16. translate(phrase, m);
  17. }
  18.  
  19. public static Map<String, String> getDictionary() {
  20. return getDictionary(true);
  21. }
  22.  
  23. public static Map<String, String> getDictionary(boolean useEnglishKey) {
  24.  
  25. String[] dictionary = { "again","po","air","vellak","all","buurd","allow","lax","alteror","dipi","amulet","bacca","and","en","and","ulp","anger","grrth","antidote","'dote","any","prak","aoe","resancae","art","maxtrik","artifact","hruril","as","aw","at","ek","attack","pantz","attacks","attakjsks","avatar","aviktra","avoid","gwelf","away","vorasha","back","anti","bad","puuu","bane","xizjkama","banish","vzedk","battlewaker","dargonn","be","sba","because","ngig","become","gnetam","betray","betrasis","blade","honl","bloody","vyoovs","blue","scyla","bring","efron","but","xup","can","wepz","care","ventil","chakram","pow-itake","chamele","ulvsuti","change","volu","chaos","choa","charm","pow-sees","circle","spira","city","spira-arc","clothes","jeoktl","codex","apo","collapse","kipaktra","collapsed","kapuxtra","comes","coatm","coming","cmag","consume","ztaglin","cookie","coogie","corrupt","calpurs","counts","xnombo","crest","hyzta","crime","jiffl","crystal","beso","curse","guexe","dance","ladhe","dark","nocgofp","darkmare","kotoke","daughter","beanfon","day","solbex","daymare","datoke","death","klatr","destroy","ztath","disappear/evaporate/fire/destroyer","ztatha","diamond","tyhtni","die","frrgth","difference","dsis","do","prnaf","dol","lum","drain","eobek","dreamer","eovoc","duel","contrk","earn","kiptotik","earth","elo","eat","gobolo","eclipse","'klips","egg","zaaaa","ehhh","fff","eight","pln","elemen","petha","enemy","omono","enhance","ehaknce","essence","ekonu","essences","ekonus","every","eheh","everyone","eheheoke","everywhere","ehehvdere","evil","uuura","evoke","flhba","expect","expacta","expects","expacts","eye","kata","face","bvauiq","far","vzidal","female","tha","fire","atsila","first","prim","five","gec","flame","atsila-jospi","follow","ifnru","fool","ngi","fools","ngis","for","pal","four","mfln","free","weeak","friend","dorfn","fun","fuma","funny","kard","gen","yewvashk","girl","thama","give","creeak","go","voragar","good","mrul","goodbye","gagaron","gote","got","great","bimrul","greet","prnaf","grins","grwij","guardian","holow","halo","maxsple","hammer","smalt-honl","happy","trefny","hat","zfan","hate","odpor","have","amne","hc","calor","hello","aieka","help","porce","here","dap","hide","skryt","hide","skyrt","hit","smalt","horde","arak","house","ara","how","pa","however","ngea","hunt","ambak","hunter","kuntra","hurt","tese","if","ef","imprison","qnuasej","in","in","is","isis","it","ejt","item","itaka","items","itakas","join","glu","judgement","njazk","kill","carnge","know","klopa","knowledge","nawlej","koes","nocto","lack","hla","lake","unadeli","lead","nhon","leave","plahka","lesson","gohwel","life","ganodu","light","luminae","like","niila","listen","sge","longwinded","gvilta","look","ni","lose","qyno","love","nula","make","kipotik","male","cha","many","muh","mare","kotke","maren","kototke","master","baka","mate","iomoc","me","neki","memories","eonimus","mighty","palg","near","intimni","need","musit","nest","payna","next","kecz","night","nocowuda","nine","dok","no","tzi","none","nic","not","tzin","now","pas","of","da","okdiedokie","kie'die","old","zal","on","etn","one","hum","oosn","lun","or","bz","or","e","otherwise","glbi","owner","majet","parent","patriad","peace","pracie","pearl","pajnara","penis","ickna","perish","flata","piss_off","kial_otk","play","dacta","poison","vnom","por","solkr","portal","porl","power","maxtrika","powerful","maxtra","prepare","grrzt","prime","bimrul-hruril","protect","yubnub","puny","putra","relative","palp","release","capthk","require","gross","restore","resanc","return","jospi","return","depax","revulsion","creeak-goss'na","room","arc","ruler","hhref","run","druh","sad","smutn","same","imnk","sanctuary","kipkge","save","kimip","scared","vang","scholar","vorsate","scourge","zta-kuntra","see","zap","seneschal","hhrak","seven","jos","shield","yub-itaka","shithead","pojo","shoot","pow","sir","qqpritzy","six","nmi","small","imelv","some","peco","son","seplan","sorry","mathz","souls","ventils","soulsphere","nocowle","speak","rict","sphere","orbtka","stagger","shuuk","steal","krast","stop","klapka","student","ashagrie","summon","sumaxtra","swim","sphplisch","take","ktak","talk","kajna","teach","lanna","teacher","dideyohvsgi","telescope","akatati","ten","bipl","than","tajnee","thank","fak","that","etok","the","ny","them","nek","then","ne","those","dos","threaten","moka","three","krp","tick","chuk","time","dagiawuga","to","na","trade","danal","trail","nvneh","trap","qufn","trash","guasata","trust","kartel","two","debll","understand","minit","uoc","unc","wait","ceka","want","wafa","ward","klamxtexa","warrior","qntfa","was","waqa'd","water","akzur","what","vdat","when","vden","where","vdere","why","eh","will","waqa","with","quop","words","vakal","wounded","wouex","yall","buurdna","yes","besa","you","hw","young","nita","aeika","hello","maren curse","kilktok/pliktok","aeika neki","hello i am","afraid","vang","aeikna heki","hello all i am","afraid all","vangni","aeka","great mare","again","foa/fia","aekna","great mares/respect for mare","all","burrd/buurd/buuurd","aieka","hello","alteror","dipi","aiekna","hello all","amulet","bacca","ana","and","and","ana/en/mo/ulp","anti","between/behind","antidote","'dote","apo","codex","AoE","behotew/resancae","ara","house member/house","are you","klopta","arc","room","art","maxtrik","atsala-isopi","reward","artifact","perm-itaka","attakisha","attack","as","aw","attakjsha","attack","at","nip","attakjski","attack","attack","attakisha/attakjsha/attakjska/attaksk","attakjsks","attacks","attacks","attaksjsks","attaksk","attack","avatar","actrka/axtra/aviktra","aviktra","avatar","avatars","axtrka","aww","as/same","away","mafsra/vorasha","axtra","avatar","baby","xadx","axtrka","avatars","bad","pittz","bacca","amulet","be","ulp","bamra","blade","become","beh","bana","man","befriend","efron","bapa","UoC","behind","anti","baqa","beware","believe","sge","beanfon","daughter","betray","betrasis","beas","yes","between","anti","beex","here","beware","baqa","beh","become/go","beware of our master","quop baka/quop baqa","behotew","AoE","blade","bamra","besa","yes","blue","scyla","beso","crystal","bring","vata","betrasis","betray","but","xup","bigtr","DoL","can","waqa","bimrul","general","care","hur/ventil","bin","that/other","caves","karnavl","bkote","OoSM","chakram","pow-itake","bnnti","shield","chaos","chao","bnu","touch","Chaos Eclipse","Kao’klips","bovar","PoR","chaotic dreamer","paana","boxtra","GoE","charm","pow-sees","brotew","HC","chase","ophosh","buna","only","Chasm","kasm","burd","all","circle","spira","buurd","all","closed","suti","buurdna","everything","codex","apo","buuurd","all","collaspe","kipaktra/kipaxtra/zdak","cadan","mare sect","collapsed","kapuxtra","calor","HC","come","coatm/coatum/vata","calpurs","why","coming","cmag","carnge","kill","comrade","comatra","cekat","wait","correct","monon","cha","male","counts","xnombo","chao","chaos","cowardly","paan","chuk chuk","time passes","crystal","beso","chuk","tick","darkmare","kotoke","cmag","coming","dark mares","kotovok","coatm","come","daugheter","beanfon","coatum","come","death","frrgth","comaxtra","comrade","depart","depax","crange","kill","die","frrgtht/prazah","creeak","give","difference","dsis","creeak gossna","receive","different than","dsis gntf","dacta","attack/play","disappear/evaporate/fire/destroyer","ztatha","dami","understand","DoL","bigxtr/lum","dantanle","Dreamer","drain essence","eobek","danto","teach/teacher","dread","uurg/uuurg","da","of","dream","eovov","dap","here","dreamer","eokius/eoknu/eovek/eovoc/drayatha","dargone","gone/ran","Dreamer","dantanle","depax","depart/gone","dreamer essence","ekonu/eoknus/tetta","dideyohvsgi","teacher","earn","kipotik/kiptotik","dipi","alteror","eat","eakt","dorfn","friend","egg","ogv/zaaa","dos","that/those","elemen","patha","'dote","antidote","elsewhere","vorasha","drayatha","dreamer","enemy","omono","druh","run","English","eovtoc","dsis","difference","equal","nike","dsis gntf","different than","essence","edsexoe/esqwex/exequex/exoquex/edoxsove","dum","two","essences","exeqcoxe/exes","eakt","eat","disappear/evaporate/fire/destroyer","ztatha","edoxsover","essence","everyone","buuurdna/eheheoke","edsexoe","essence","everywhere","ehehvdere","eema","sorry","evil","uura/uuura","ef","if","evoke","hyn","efron","befriend","expects","expacts","eheheoke","everyone","eye","kata","ehehvdere","everywhere","far","vsidal/vzidal","eh","how/why","female","tha","ekonu","dreamer essence","fight","pantz/ztath/prazah","ek","to","fight others","ztath","elo","floor/ground","disappear/evaporate/fire/destroyer","ztatha","en","and","first","kuntra","eobek","drain essence","floor","elo","eokius","dreamer","follow","ifnru","eoknu","dreamer/hunter","follow me","neki ifneu","eoknus","dreamer essence","follower","irfnu","e","or","followers","irfnuna","eovac","kill","fool","pojo/qntf","eovek","kill","for","dak/fon/pal","eovoc","dreamer","force restore","largnana","eovov","dream","free spirit","paana","eovtoc","English","friend","dorfn/nowcle/whosti","erirfnu","leave","friend for life","whoh","esqwex","essence","from","xkoz","exeeqcoxe","essences","front","prim","exequex","essence","girl","thama","exes","essences","give","creeak/jospi/jsopi","exoqcoxe","essence","general","bimrul/hruril","expacts","expects","get","kipotik","fak hw","thank you","go","burjk/voagar/voragar/beh","fia","again","go away","nhon","flaata","perish","GoE","got/boxtra","flata","perish","gone","dargone/depax/mafsra","foa","again/now","good","puu","fqw","small/short","good friend","whotl/whotsl","frrgth","death","goodbye","garagon/goragon/gagaron","frrgtht","die","great mare","aeka","gagaron","goodbye","great mares","aekna","garagon","goodbye","grin","grwij","gntf","than","ground","elo","gohwel","lesson","guardian","holow","goragon","leave/goodbye","happy","shiru","got","GoE","has","ha","grrth","hurt","have","wala","grrzt","prepare","HC","brotew/calor","gru","with/of","hello","aeika/aieka","grwij","grin","hello all","aeikna/aiekna","grzzt","prepare","hello all/i am","aeikna neki","guasata","reason","hello/i am","aeika neki","guasta","things","help","po'op/porce","guok","you","help all","po'opni","gvilta","long winded","here","beex/dap/ionon/qufn","gyrkth","share","hide","skyrt","ha","has","house","kranda/kronda/ara","hhref","ruler","house member","ara","holow","guardian","how","eh/pa","hruril","general","hunter","eoknu","hum","one","hurt","pantz","hur","care","hurt/attack","grrth","hw","you","i","vodo","hyn","evoke","i am","neki isis/ulpda","ifnru","follow","i am the mighty","palg ulpda isis","imkip","stay","i don't","vodo no","imnk","same","i won't","ngig","iomac","mate with/mate","if","ef/ni","iomoc","mate with/mate","initiate","kifflo","ionon","here","is","isis/ix","irfnu","follower","item","itaka","irfnuna","follower","kill","carnge/crange/eovac","isis","is","know","klope/knu/kon/nowley/klopra","itaka","item","knowledge","nawlej/nowlej","itakas","take item","KoES","notco","ix","is","leave","gotagon/plahka/erirfnu","jospi","give","lesson","gohwel","jsopi","give/offer","let","lax","kajna","speak","like","nike","Kao’klips","Chaos Eclipse","little","putra","Kao’klips","ChaosEclipse","long winded","gvilta","kapuxtra","collapsed","look","zap","karnavl","caves","looking","zapatzk","kartel","trust","love","nula/tala","kata","eye","mad","pi'ip","katoke","mare","male","cha","kazm","Chasm","make","kipotik","kecz","next","man","bana","kifflo","initiate","mare","katoke/kotke","kilktok","((maren curse))","mare sect","cadan/satex","kipaktra","collapse","Maren","kototke","kipaxtra","collapse","mate","iomozc/iomoc","kipkge","sanctuary","me","neki","kipotik","earn/get/make","mighty","palg/plag","kiptotik","earn","more","momo/po","kirra","yesterday","much","nonto","klapka","stop","my name is","palq ulpda","klope","know","need","musit/lax","klopra","know","nest","payne","klopta","are you","nevermind","tzinna","knu","know","next","kecz","kon","know","no","nos/tzi","korra","today","none","nic","kotka","mare","not","tzin","kotoke","darkmare","now","foa/pa/pas/nimma","kototke","maren","of","da/gru/ti","kototvoc","the dream","offer","jsopi","kotovok","dark mares","one","hum","kranda","house","only","buna","krast","steal","OoSM","bkote/lun","kronde","house","open","safa","krs","try","or","e/mon","ktak’d","took","other","bin","ktak","take","owner","majet","kuntra","first","parent","palp","lanna","teach","peace","pariah/pracie/prich","largnana","force restore/soul evoke","perish","flaata/flata","larng","restore","plan","plad/tese","lax","let/need","play","dacta","lum","DoL","poison","vnom","lun","OoSM","PoR","solkr/bovar","mafsra","gone/away","portal","porl","majet","owner","power","maxtrik/maxtrika","mathzni","sorry you all","powerful","maxtra","mathz","sorry","perpare","grrzt/grzzt","maxtra","powerful","protect","yubnub","maxtrika","power/strengthen","ran","dargone","maxtrik","power/art","reason","guasata","minit","understand","receive","creeak gossna","mo","and","relative","pal/palp","moke","threaten","restore","larng/resanc","momo","more","reward","atsila-jspoi","monon","correct","room","arc","mon","or","ruler","hhref","musita","needs","run","druh","musit","need","sad","smutn","mu","you","safe","qufn","na","the","same","aw/imnk/nurata","neki ifneu","follow me","sanctuary","kipkge","neki isis","i am","see","zap","neki","me","share","gyrkth","ngig","i won't","shield","yub-itaka/bnnti","nhon","go away","short","fqw","nic","none","sir/madam","qqpritzy","nike","equal/like","small","fqw","nimma","now","some","peco","nip","at","son","seplan","nita","with","sorry","eema/mathz","ni","to/if","sorry/you all","mathzni","nocowle","soulsphere","soul evoke","largnana","nowcle","friend","soulsphere","nocwole/nowcowle","nowlej","knowledge","speak","rict/vacal/cakal/kajna","nowley","know","stay","qufn/imkip","nula","love","steal","krast","nurata","same","stop","klapka","odpor","war","strengthen","maxtrika","ogv","egg","summon","sumaxtra","omono","enemy","swim","sphplisch","ophosh","chase","swimming","schplisching","paana","free spirit/chaotic dreamer","take","ktak","paan","cowardly","take item","itakas","pa","how or now","teach","danto/lanna","palg","mighty","teacher","danto/ideyohvsgi","palg ulpda isis","i am the mighty","tell me","rict neki","palp","parent/relative","than","gntf","palq ulpda","my name is","thank you","fak hw","pal","relative/for","that","bin/dos","pantz","fight/hurt","the","na","pariah","peace","the dream","kototvoc/kototvok","pas","now","then","ne","payna","nest","things","guasta","peco","some","those","dos","perm-itaka","artifact","threaten","moka","petha","elemen","tick","chuk","pi'ip","mad","time","dagiawuga","pittz","bad","time passes","chuk chuk","plad","plan","to","ti/ni/um/ek","plag","mighty","today","korra","plahka","leave","took","ktak’d","pliktok","((maren curse))","touch","bnu","pojo","fool","trust","kartel","po","more","try","krs","po'op","help","two","dum","po'opni","help all","understand","dami/minit","porce","help","UoC","unc/bapa","porl","portal","voice","vacal/vakal","pow","fire (shoot)","wait","cekat","pow-itake","chakram","want","wafa","pow-sees","charm","war","odpor","pracie","peace","was","wana","prazah","die/fight","weak","puuu","prich","peace","what","vdat","prim","front","when","vden","putra","little","where","vdere","puu","good","why","calpurs/eh","puuu","bad/weak","will","waga/waka/waqa","qntf","fool","wind","wd","qqprtzy","sir/madam","with","gru/quop/nita","qufn","stay/here/safe","won’t","waqa’d","quop baka","beware of our master","words","vacal/vakal","quop baqa","beware of our master","wounded","wouex/wovex","quop","with","yes","besa/beas/xup","resanc","restore","yesterday","kirra","rict neki","tell me","you","guok/hw/mu","rict","speak","youth","yodth","safa","open","satex","mare sect","schplisching","swimming","scyle","blue","seplan","son","sge","believe","shiru","happy","skyrt","hide","smutn","sad","solkr","PoR","sphplisch","swim","spira","circle","sumaxtra","summon","suti","closed","tala","love","tese","plan","tette","dreamer essence","tha","female","thama","girl","ti","to/of","tzinna","nevermind","tzin","not/don’t","tzi","no","ulp","be/and","ulpda","i am","um","to","unc","UoC","uura","evil","uurg","dread","uuura","evil","uuurg","dread","vacal","words/speak/voice","vakal","words/speak/voice","vang","afraid","vangni","afraid all","vats","come/bring","vdat","what","vden","when","vdere","where","ventil","care","vnom","poison","voagar","go","vodo","i","vodo no","i don't","voragar","go","vorasha","away/elsewhere","vsidal","far","vzidal","far","wafa","want","waga","will","waka","will","wala","have","wana","was","waqa","can/will","waqa’d","won’t","wd","wind","whoh","friend for life","whotl","good friend","whotsi","friend","whotsl","good friend","wouex","wounded","wovex","wounded","xadx","baby","xkoz","from","xnombo","counts","xup","but/yes","yodth","youth","yub-itake","shield","zaaa","egg","zapatzk","looking","zap","see/look","zdak","collapse","ztah","fight/fight others","ztatha","disappear/evaporate/fire/destroyer" };
  26.  
  27. Map<String, String> m = new HashMap<String, String>();
  28.  
  29. for (int i = 0; i < dictionary.length; i += 2) {
  30. if(useEnglishKey) {
  31. m.put(dictionary[i], dictionary[i + 1]);
  32. } else {
  33. m.put(dictionary[i + 1], dictionary[i]);
  34. }
  35. }
  36.  
  37. return m;
  38. }
  39.  
  40. public static void translate(String textToTranslate, Map<String, String> map) {
  41. // Split the text parameter
  42. String[] words = textToTranslate.split(" ");
  43. List<String> finalStrList = new ArrayList<String>();
  44. String finalStr = "";
  45.  
  46. for (String word : words) {
  47. // check for the words in the text parameter
  48. if (map.containsKey(word.toLowerCase())) {
  49.  
  50. // get value
  51. finalStrList.add(map.get(word.toLowerCase()));
  52. } else {
  53. System.out.println(String.format("Could not find key %s", word));
  54. }
  55. }
  56.  
  57. for (String w : finalStrList) {
  58. finalStr += w + " ";
  59. }
  60.  
  61.  
  62. System.out.println(finalStr.trim());
  63. }
  64.  
  65. public static void translateFromMaren(String textToTranslate, Map<String, String> map) {
  66. // Split the text parameter
  67. String[] words = textToTranslate.split(" ");
  68. List<String> finalStrList = new ArrayList<String>();
  69. String finalStr = "";
  70.  
  71. for (String word : words) {
  72. // check for the words in the text parameter
  73. if (map.containsValue(word.toLowerCase())) {
  74. // get value
  75. finalStrList.add(map.get(word.toLowerCase()));
  76. }
  77. }
  78.  
  79. for (String w : finalStrList) {
  80. finalStr += w + " ";
  81. }
  82. System.out.println(finalStr.trim());
  83. }
  84. }
Success #stdin #stdout 0.15s 321280KB
stdin
hw wafa minit kotoke
stdout
Translating phrase...
you want understand darkmare