필터 지우기
필터 지우기

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 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