linkedin facebook linkedin facebook nod32

Delphi dasturlash tilida tarjimon dastur yaratish strukturasi

Muallif: Mengliyev Sh.

Qo`shilgan sana: 2014-09-19

Delphi dasturlash tilida tarjimon dastur yaratish strukturasi


Datur dizayni yaratib olamiz rasm 1.

rasm 1.

Dastur kodi quyidagicha
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Menus, ComCtrls;

type
TForm1 = class(TForm)
txtUZBTEXT: TEdit;
txtRUSTEXT: TEdit;
btnTransText: TButton;
Memo1: TMemo;
Memo2: TMemo;
Button1: TButton;
MainMenu1: TMainMenu;
Fayl1: TMenuItem;
Ochish1: TMenuItem;
Saqlash1: TMenuItem;
Yangi1: TMenuItem;
Chiqish1: TMenuItem;
arjima1: TMenuItem;
Ozbruz1: TMenuItem;
RUSOZB1: TMenuItem;
Fahrir1: TMenuItem;
Nusxalash1: TMenuItem;
Qoyish1: TMenuItem;
Qirqish1: TMenuItem;
Malumotnoma1: TMenuItem;
Yordam1: TMenuItem;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
FontDialog1: TFontDialog;
StatusBar1: TStatusBar;
Shirst1: TMenuItem;
Dasturhaqida1: TMenuItem;
procedure FormShow(Sender: TObject);
procedure btnTARJClick(Sender: TObject);
procedure btnTransTextClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Yangi1Click(Sender: TObject);
procedure Ochish1Click(Sender: TObject);
procedure Saqlash1Click(Sender: TObject);
procedure Chiqish1Click(Sender: TObject);
procedure Ozbruz1Click(Sender: TObject);
procedure RUSOZB1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function tarjimaUZB_RUS(wordUZ:string):string;
function tarjimaRUS_UZB(wordUZ:string):string;
end;

var
Form1: TForm1;
lugat_u_r: array[0..300000,0..1] of string[100];
i:integer;

implementation

{$R *.dfm}

procedure TForm1.FormShow(Sender: TObject);
begin
lugat_u_r[0,0]:='kitob'; lugat_u_r[0,1]:='kniga';
lugat_u_r[1,0]:='qalam'; lugat_u_r[1,1]:='karandash';
lugat_u_r[2,0]:='ona'; lugat_u_r[2,1]:='mama';
lugat_u_r[3,0]:='meni'; lugat_u_r[3,1]:='u menya';
lugat_u_r[4,0]:='kitobim'; lugat_u_r[4,1]:='kniga';
lugat_u_r[5,0]:='bor'; lugat_u_r[5,1]:='est';
lugat_u_r[6,0]:='kuchigim'; lugat_u_r[6,1]:='sobaka';
lugat_u_r[7,0]:='tutildim'; lugat_u_r[7,1]:='zatmenie';
lugat_u_r[8,0]:='men'; lugat_u_r[8,1]:='ya';
lugat_u_r[9,0]:='bu'; lugat_u_r[9,1]:='eto';
lugat_u_r[10,0]:='kitobni'; lugat_u_r[10,1]:='knigai';
lugat_u_r[11,0]:='turtmoq'; lugat_u_r[11,1]:='tolkat`';
lugat_u_r[12,0]:='tarjima'; lugat_u_r[12,1]:='prevod';
lugat_u_r[13,0]:='kuldim'; lugat_u_r[13,1]:='delat`';
lugat_u_r[14,0]:='turish'; lugat_u_r[14,1]:='stoyanie';
end;
procedure TForm1.btnTARJClick(Sender: TObject);

begin
for i:=0 to 300000 do
end;
function TForm1.tarjimaUZB_RUS(wordUZ:string):string;
begin

for i:=0 to 300000 do
begin
if lugat_u_r[i,0]=wordUZ then
begin
tarjimaUZB_RUS := lugat_u_r[i,1];
end;
end;
end;

function TForm1.tarjimaRUS_UZB(wordUZ:string):string;
begin

for i:=0 to 300000 do

 

if lugat_u_r[i,1]=wordUZ then
begin
tarjimaRUS_UZB := lugat_u_r[i,0];

end;
end;
procedure TForm1.btnTransTextClick(Sender: TObject);
var
uzText, wordUZ, wordRU : String;
i:integer;
startW, endW : integer;
begin
txtRUSTEXT.Text:='';
txtUZBTEXT.Text:=Memo1.Text;
begin
uzText:=txtUZBTEXT.Text;
startW:=1;
endW:=1;
for i:=1 to length(uzText) do
begin
if uzText[i]=' ' then
begin
endW:=i;
wordUZ:=Copy(uzText, startW, endW-startW);
wordRU := tarjimaUZB_RUS(wordUZ);
txtRUSTEXT.Text:=txtRUSTEXT.Text + ' ' + wordRU;
startW:=i+1;
end;
end;
Memo2.Text:=txtRUSTEXT.Text;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);

var
uzText, wordUZ, wordRU : String;
i:integer;
startW, endW : integer;
begin
txtRUSTEXT.Text:='';
txtUZBTEXT.Text:=Memo1.Text;
begin
uzText:=txtUZBTEXT.Text;
startW:=1;
endW:=1;
for i:=1 to length(uzText) do
begin
if uzText[i]=' ' then
begin
endW:=i;
wordUZ:=Copy(uzText, startW, endW-startW);
wordRU := tarjimaRUS_UZB(wordUZ);
txtRUSTEXT.Text:=txtRUSTEXT.Text + ' ' + wordRU;
startW:=i+1;
end;
end;
Memo2.Text:=txtRUSTEXT.Text;
end;
end;
procedure TForm1.Yangi1Click(Sender: TObject);
begin
Memo1.Text:='';
Memo2.Text:='';
end;

procedure TForm1.Ochish1Click(Sender: TObject);
begin
if OpenDialog1.Execute then Memo1.Lines.LoadFromFile(OpenDialog1.FileName);
Form1.Caption:='Tarjima - '+ OpenDialog1.FileName
end;

procedure TForm1.Saqlash1Click(Sender: TObject);
begin
if SaveDialog1.Execute then if (Pos('.',SaveDialog1.FileName)<1)
then Memo2.Lines.SaveToFile(SaveDialog1.FileName+'.txt')
else Memo2.Lines.SaveToFile(SaveDialog1.FileName);

end;

procedure TForm1.Chiqish1Click(Sender: TObject);
begin
Close;
end;

procedure TForm1.Ozbruz1Click(Sender: TObject);
begin
btnTransText.Click;
end;

procedure TForm1.RUSOZB1Click(Sender: TObject);
begin
Button1.Click;
end;

end.

3001 marta o`qildi.

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений