На большинстве музакальных mp3 дисков названия песен написаны транслитом. Это не всегда бывает удобно, особенно когда приходится копировать диски и впоследствии искать какую-либо песню. Данная программа автоматически переводит из транслита в кирилицу все файлы, находящиеся в указанном каталоге. Программа еще нуждается в доработке, но основное делать она умеет. Пишите о желаемых добавлениях, кстати, сочетание DJ программа не транслитизирует Вот функция, которая обеспечивает перевод транслита в кирилицу: function translit(s:string):string; var i:integer; begin i:=0; s:=wordupcase(s); repeat inc(i); if i+1<=length(s) then if (s[i]='Y') and (s[i+1]='A') then begin s[i]:='Я'; delete(s,i+1,1); end;
if i+1<=length(s) then if (s[i]='Y') and (s[i+1]='U') then begin s[i]:='Ю'; delete(s,i+1,1); end;
if i+1<=length(s) then if (s[i]='Y') and (s[i+1]='O') then begin s[i]:='Ё'; delete(s,i+1,1); end;
if i+4<=length(s) then if (s[i]+s[i+1]+s[i+2]+s[i+3]='CHSH') then begin s[i]:='Щ'; delete(s,i+1,1); delete(s,i+2,1); delete(s,i+3,1); end;
if i+1<=length(s) then if (s[i]='C') and (s[i+1]='H') then begin s[i]:='Ч'; delete(s,i+1,1); end;
if i+1<=length(s) then if (s[i]='S') and (s[i+1]='H') then begin s[i]:='Ш'; delete(s,i+1,1); end;
if i+1<=length(s) then if (s[i]='Z') and (s[i+1]='H') then begin s[i]:='Ж'; delete(s,i+1,1); end;
if i+1<=length(s) then if (s[i]='K') and (s[i+1]='H') then begin s[i]:='Х'; delete(s,i+1,1); end;
if i+1<=length(s) then if (s[i]='T') and (s[i+1]='S') then begin s[i]:='Ц'; delete(s,i+1,1); end;
if i+1<=length(s) then if (s[i]='''') and (s[i+1]='''') then begin s[i]:='Ъ'; delete(s,i+1,1); end;
if i+1<=length(s) then if (s[i]='I') and (s[i+1]='I') then begin s[i]:='Й'; delete(s,i+1,1); end;
if (s[i]='X') then begin s[i]:='К'; s:=copy(s,1,i)+'C'+copy(s,i+1,length(s)-i); end;
if s[i-1]<>'D' then if (s[i]='J') then begin s[i]:='Д'; s:=copy(s,1,i)+'Ж'+copy(s,i+1,length(s)-i); end;
if (s[i]='''') then s[i]:='Ь'; if (s[i]='A') then s[i]:='А'; if (s[i]='B') then s[i]:='Б'; if s[i+1]<>'J' then if (s[i]='D') then s[i]:='Д'; if (s[i]='E') then s[i]:='Е'; if (s[i]='F') then s[i]:='Ф'; if (s[i]='G') then s[i]:='Г'; if (s[i]='H') then s[i]:='Х'; if (s[i]='I') then s[i]:='И'; if (s[i]='K') then s[i]:='К'; if (s[i]='L') then s[i]:='Л'; if (s[i]='M') then s[i]:='М'; if (s[i]='N') then s[i]:='Н'; if (s[i]='O') then s[i]:='О'; if (s[i]='P') then s[i]:='П'; if (s[i]='R') then s[i]:='Р'; if (s[i]='S') then s[i]:='С'; if (s[i]='T') then s[i]:='Т'; if (s[i]='U') then s[i]:='У'; if (s[i]='V') then s[i]:='В'; if (s[i]='W') then s[i]:='В'; if (s[i]='Y') then s[i]:='Ы'; if (s[i]='Z') then s[i]:='З';
until i=length(s); result:=s; end;
|