I have a program in Python 2.7 that does the following:
- Ask the user for input (In Non English characters. E.g. Hebrew, English)
- Split each character of the sentence in a list. (The input can be a small paragraph, or an email)
- Convert the characters to Unicode values. So in the end every item of the list is a unicode escape char e.g.
"u/0391"
that can be manipulate it as string.
Ι started quite well but I can't split the letters in the array nor print the right unicode value.
Gr_text = unicode(raw_input("Type your message below:\n"), 'unicode-escape')
Gr = Gr_text.split()
print Gr
Example input:
Ενα απλο παραδειγμα.
The input (translate as "A simple example") is in Greek language without intonations. This sentence should be transform in a list as
['\u0395', '\u03bd', '\u03b1','\u0020', '\u03b1', '\u03c0', '\u03bb', '\u03bf','\u0020', '\u03c0', '\u03b1', '\u03c1', '\u03b1', '\u03b4', '\u03b5', '\u03b9', '\u03b3', '\u03bc', '\u03b1','\u0020',]
To point out I also want to convert spaces and special characters. Then I get every letter of the list as string of unicode and not as simple letter so I can manipulate and give it other value.