convert numbers to arabic letters

3 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Timing and presenting 2D and 3D stimuli 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by