All of the Greetings;
I have a desktop Java application that gives the following output in the console window: I would like to strip this string:" \ u0623 \ u0646 \ u0627 "to proceed further on this string, from the whole output. I do not know how to do this? But one of the ideas is to use Reggae but how can I do this? Would you help me? Additional information Output will not be arabic characters \ u064A. . e.t.c. My idea was to find the output \ u064 A ... to line up and convert them to Arabic. Are you my thing I do not know how to solve it, I'm starting in Java. Sorry for the illusion and thanks for your feedback. And that input comes from you, you can solve it like this: [["Eve": "Ana" "HWS": ["\ u0623 \ U0646 \ u0627 "]}]
import java.net *; Import java.io * *; Import java.util. *; Import java.util.regex *; Public class URLConnectionReader {public static void throws exceptions {URL googleUrl = new URL ("http://www.google.com/transliterate/arabic?tlqt=1&langpair=en|ar&text= Anna , MĂ‚asry & amp; tl_app = 1 "); URLConnection googleUrlc = googleUrl.openConnection (); BufferedReader = new BufferedReader (new InputStreamReader (googleUrlc.getInputStream ())); String inputline; Pattern wordRegex = Pattern.compile ("\" (\\\\ u [\\ da-z] {4}) + \ "", Pattern.CASE_INSENSITIVE); Pattern charRegex = Pattern.compile ("\\\\ u ([\\ da-z] {4})", pattern. CASE_INSENSITIVE); While ((inputLine = in.readline ()) = null (word match = word regex. Mater (inputline); For (int i = 0; wordMatch.find (); i ++) {stringbufferrabibhref = new stringbuffer (); Matcher charMatch = charRegex.matcher (wordMatch.group ()); For (int j = 0; charMatch.find (); J ++) {arabicBuffer.appendCodePoint (Integer.valueOf (charMatch.group (1), 16)); } If (0 and lt; arabic buffer.length ()) {System.out.println (ArabicBuffer.stosting ()); }}} In.close (); }}
Comments
Post a Comment