27 Mart 2010 Cumartesi

Büyük Ve Küüçük Ünlü Uyumları

function buyukunluuyumu (cevirlecek:string):Boolean;
var kelimeuzunlugu,i,n:integer; konum:integeR; sonuc:string; unludeposuString; kalinvar,incevar:Boolean;
begin
kalinvar:=false;incevar:=false;unludeposu:='';
for i:=1 to length(cevirlecek) do begin sonuc:=copy(cevirlecek,i,1);
if (sonuc='a') or (sonuc='ı') or (sonuc='o') or (sonuc='u') or (sonuc='e') or (sonuc='i') or (sonuc='ö') or (sonuc='ü') then unludeposu:=unludeposu+sonuc;
end;
sonuc:='';
for n:=1 to Length(unludeposu) do begin sonuc:=copy(unludeposu,n,1);
if (sonuc='a') or (sonuc='ı') or (sonuc='o') or (sonuc='u') then kalinvar:=true;
if (sonuc='e') or (sonuc='i') or (sonuc='ö') or (sonuc='ü') then incevar:=true;end;
if (incevar=false) and (kalinvar=true) then
Application.MessageBox('Büyük Ünlü Uyumuna Uyar','Bilgi',MB_ICONINFORMATION+MB_OK);
if (incevar=true) and (kalinvar=false) then
Application.MessageBox('Büyük Ünlü Uyumuna Uyar','Bilgi',MB_ICONINFORMATION+MB_OK);
if (incevar=true) and (kalinvar=true) then
Application.MessageBox('Büyük Ünlü Uyumuna Uymaz.!','Dikkat!',MB_ICONWARNING+MB_OK);
end;

function kucukunluuyumukuralbir (kelime:string):Boolean;
var sonuc:string; n:integer;
begin
for n:=1 to length(kelime) do begin sonuc:=copy(kelime,n,1);
if (sonuc='a') or (sonuc='ı') or (sonuc='e') or (sonuc='i') then result:=true;
if (sonuc='o') or (sonuc='ü') or (sonuc='ö') or (sonuc='u') then begin
Result:=false; exit; end;end;end;

function kucukunluuyumukuraliki (kelime:string):Boolean;
var
sonuc:string;
n:integer;
sonucnext:string;
begin
for n:=1 to length(kelime) do begin sonuc:=copy(kelime,n,1);
if (sonuc='o') then begin sonucnext:=copy(kelime,n,1);
if (sonucnext='a') or (sonucnext='e') or (sonucnext='u') or (sonucnext='ü') then
result:=true; end;
if (sonuc='u') then begin sonucnext:=copy(kelime,n,1);
if (sonucnext='a') or (sonucnext='e') or (sonucnext='u') or (sonucnext='ü') then
result:=true;end;
if (sonuc='ö') then begin sonucnext:=copy(kelime,n,1);
if (sonucnext='a') or (sonucnext='e') or (sonucnext='u') or (sonucnext='ü') then
result:=true;end;
if (sonuc='ü') then begin sonucnext:=copy(kelime,n,1);
if (sonucnext='a') or (sonucnext='e') or (sonucnext='u') or (sonucnext='ü') then
result:=true;end;
if (sonuc='ı') or (sonuc='i') then begin
Result:=false;
exit;end;end;end;

procedure TForm1.Button1Click(Sender: TObject);
begin
buyukunluuyumu(Edit3.Text)
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if kucukunluuyumukuralbir(Edit3.Text)=true then
Application.MessageBox('Kural 1 e Göre Uyar','Bilgi',MB_ICONINFORMATION+MB_OK) else
Application.MessageBox('Kural 1 e Göre Uymaz','Dikkat !',MB_ICONWARNING+MB_OK) ;
if kucukunluuyumukuraliki(Edit3.Text)=true then
Application.MessageBox('Kural 2 ye Göre Uyar','Bilgi',MB_ICONINFORMATION+MB_OK) else
Application.MessageBox('Kural 2 ye Göre Uymaz','Dikkat !',MB_ICONWARNING+MB_OK)
end;

procedure TForm1.edit3Change(Sender: TObject);
begin
Edit3.Text:= AnsiLowerCase(Edit3.Text)
end;
end.

Hiç yorum yok:

Yorum Gönder