convert numbers to arabic letters

1 view (last 30 days)
ben zekri raouf
ben zekri raouf on 7 Feb 2015
Hi,im working on ARABIC TTS(text to speech) and i have this program that only could replace one number by arabic letters,so i m asking if there is a better and effective way to convert text containing a lot of numbers and dates to words
PROGRAM:
slCharacterEncoding('UTF-8')
fid = fopen('arabe.txt'); %text is :(3 stars) النجوم 3
b = fread(fid,'uint8')';
fclose(fid);
a=dec2bin(b);
c=dec2hex(b);
str = native2unicode(b,'UTF-8');
disp(str);
fid = fopen('3.txt'); text is :الثلاثة(three)
b3 = fread(fid,'uint8')';
fclose(fid);
str3 = native2unicode(b3,'UTF-8');
disp(str3);
nbrasci=abs(str);
for i=1:1:length(str)
if nbrasci(i)==51;
str=char([nbrasci(1:i-1),str3,nbrasci(i+1:length(str))]); str=(three stars) النجوم الثلاثة
end
end

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!