fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class IdeoneTest
  6. {
  7. //méthode de test de la dévocalisation d'un text, ne peut pas être renommé car c'est le point
  8. //d'entrée du programme executable ici
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. ArrayList<String> inputsVocalizedText = new MockText().GetTextVocalized();
  12.  
  13. for(String textVocalized : inputsVocalizedText)
  14. {
  15. System.out.println("Avec les voyelles : " + textVocalized) ;
  16. System.out.println("Sans les voyelles : " + new Devocaliseur().Devocalise(textVocalized));
  17. }
  18. }
  19. }
  20.  
  21. class Devocaliseur
  22. {
  23. public String Devocalise(String inputText)
  24. {
  25. return inputText.replaceAll("[\u064e\u064f\u0650]","");
  26. }
  27. }
  28.  
  29. class MockText
  30. {
  31. public MockText(){}
  32.  
  33. ArrayList<String> GetTextVocalized()
  34. {
  35. ArrayList<String> words = new ArrayList<String>();
  36.  
  37. words.add("كُتب" );// kutibaat
  38.  
  39. return words;
  40. }
  41. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Avec les voyelles : كُتب
Sans les voyelles : كتب