Effacer les filtres
Effacer les filtres

convert numbers to arabic letters

3 vues (au cours des 30 derniers jours)
ben zekri raouf
ben zekri raouf le 7 Fév 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

Réponses (0)

Catégories

En savoir plus sur Timing and presenting 2D and 3D stimuli dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by