フィルターのクリア

convert numbers to arabic letters

3 ビュー (過去 30 日間)
ben zekri raouf
ben zekri raouf 2015 年 2 月 7 日
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 Center および File ExchangeTiming 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