Once you have that tool in place on your machine, you need to convert your Arabic text from unicode to cp1256 (that version of the tool only accepts that encoding) and pipe the text as input to the "AraMorph.pl" script. The output will be a list of possible "interpretations" for each word, including part-of-speech tags, segmentation into stems and affixes, and English glosses.
Bear in mind that most Arabic words (as written in Arabic characters) are incredibly ambiguous, due in part to the fact that the words are normally written without the marks that indicate vowels and lengthened consonants, so getting an English translation for a given word is fairly speculative for those who don't know both Arabic and English.
If the "unicode" you are talking about is utf8, then "unicode English" is no different from "ascii English", because the ascii character set is a subset of utf8-encoded unicode. If you have utf-16, that's very different, because each ascii byte needs to have a null "high byte" to pad it out to 16 bits.
As for doing encoding conversions, perl makes that pretty easy. If you are starting with utf8 Arabic, and want to feed the "AraMorph.pl" tool described above, this would suffice:
If you're data is in some other form of unicode (not utf8), just change the 'binmode STDIN' part as needed.perl -e 'binmode STDIN,":utf8";binmode STDOUT,":encoding(cp1256)";prin +t while(<>)' < arabic.utf8 | AraMorph.pl > output
You'll want to consult the BAMA docs for more information about the tool and its output. (Update: since the previous reply mentioned dialects, I should point out that BAMA works only on Modern Standard Arabic, not any colloquial dialect, but that's generally not a problem, since the vast majority of writing in Arabic involves MSA.)
In reply to Re: unicode translation
by graff
in thread unicode translation
by ed111
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |