Autor Beitrag
LDMatrix17
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 73

xXpProOxsP2x
Flash5~Flash7 MX 2004 Prof.~Flash 8 Prof.~Delphi 7 prof.&HTML
BeitragVerfasst: Sa 16.09.06 12:25 
Hi @ all Delphi friends!!!

also komme direkt zur Sache.

Wie kann man am bestens eine Translator programmieren?

z. B wenn ich in Edit feld 'Mutter' eingebe dann dass er in Memofeld die Begriffen anzeigt ( mutter = 'Mother, mum, mummy' und ect. ect)
*) Will gerne .Dll benutzen weil ich dann meine Programm immerwieder updaten kann.


MFG
Christian

PS:
Wie funktionieren andere Translator programmen die ganze sätze übersetzen?
eg. "hello how are you" in "hallo wie geht es dir".^_^

_________________
~sOm3!~gUrLs!~sOm3!~dAyS!~L!f3~iS!~nOT!~bOriNg!!~
DarkLord05
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 449

WinXP Pro SP2
Opera; Delphi 3 Pro; Delphi 2005, Turbo Delphi, dev-c++, Eclipse, MS Visual Studio .NET 2003, MS Visual C++
BeitragVerfasst: Sa 16.09.06 12:41 
Zum PS:

Also die meisten programme übersetzen da die Wörter einzeln. Heißt das manchmal sehr merkwürdige Sätze rauskommen, allein schon deshalb weil viele Wörter mehrere Bedeutungen haben(: Contextfehler )und die Reihenfolge der Wörter im Englischen dann nicht mehr passen(: Satzbaufehler)
LDMatrix17 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 73

xXpProOxsP2x
Flash5~Flash7 MX 2004 Prof.~Flash 8 Prof.~Delphi 7 prof.&HTML
BeitragVerfasst: Sa 16.09.06 15:18 
ich habe etwas probiert und das läuft auch gut.
das problem ist die Datei, die wo ich alle Wörter gespeichert habe.
erstens die Datei ist eine .txt Datei.
zweitens ich vermute wenn die Datei größer wird, dass dann mein programm auch langsammer wird. :(

deswegen will ich die Wörter nach reihe in .Dlls packen.
d.h A - D kommen in "A-D.Dll"
E - H kommen in "E-H.Dll"

und wenn ich in Edit feld "Abakus" eintippe soll das programm "A-D.Dll" öffnen und da die Wörter suchen..

Vorstellen kann man aber ob man das auch realizieren kann? ^_^


ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
Procedure Translate(Text : String);
Var Datei     : TStringList;
    N         : Integer;
    Close     : Boolean;
begin
  //Initializing
  Datei := TStringList.Create;
  Close := true;
  Form1.Memo1.Clear;
  //load Source Data
  Datei.LoadFromFile(ExtractFilepath(paramStr(0))+'Wörter.txt');

  For N := 0 to Datei.Count-1 do
   begin
    if pos(Ansilowercase(text),Datei.Strings[N])>0 then
     begin
      Form1.Memo1.Lines.Add('> '+Datei.Strings[N]);
      Form1.Memo1.Lines.Add('');
      close := false;
     end//end first if
    Else if (N = Datei.Count-1) and (pos(Ansilowercase(text),Datei.Strings[N])<= 0) and (close) then
     begin
      MessageDlg('No match found',mtwarning,[mbok],0);
      exit;
     end;
   end;
   //release Data
   Datei.Free;
  
end;


procedure TForm1.Button1Click(Sender: TObject);
Var Text : String;
begin
  Translate(Edit1.Text);
end;

end.



"Wörter.txt" sieht soO aus.
mutter = mother,mummy,mum
vater = Father,dad,daddy
ect...

MFG
Christian

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt

_________________
~sOm3!~gUrLs!~sOm3!~dAyS!~L!f3~iS!~nOT!~bOriNg!!~
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 16.09.06 15:22 
Schon mal dran gedacht, eine Datenbank zu verwenden?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
LDMatrix17 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 73

xXpProOxsP2x
Flash5~Flash7 MX 2004 Prof.~Flash 8 Prof.~Delphi 7 prof.&HTML
BeitragVerfasst: Sa 16.09.06 15:34 
*lol* bin kein profi in Delphi..außerdem in der schule lernen wir gerade über "if" und "Case" nicht mal mit ini.Dateien angefangen.. ;)

will gerne mit Datenbank arbeiten aber soO weit habe ich nicht geübt :(

_________________
~sOm3!~gUrLs!~sOm3!~dAyS!~L!f3~iS!~nOT!~bOriNg!!~


Zuletzt bearbeitet von LDMatrix17 am Sa 16.09.06 15:36, insgesamt 1-mal bearbeitet
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 16.09.06 15:36 
Warum ist denn deiner Meinung nach eine dll besser zur Speicherung der Texte geeignet als eine Text-Datei?

_________________
We are, we were and will not be.
LDMatrix17 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 73

xXpProOxsP2x
Flash5~Flash7 MX 2004 Prof.~Flash 8 Prof.~Delphi 7 prof.&HTML
BeitragVerfasst: Sa 16.09.06 15:40 
wenn ich das programm weiter geben will.. dann die ganze Text dateien noch dazu..
ist doch irgendwie unproffesional :-)

Edit := sind .Dlls nicht für Texte geeignet?? :(
wenn nicht muss ich mich anstrengen und etwas über Datenbank lernen

_________________
~sOm3!~gUrLs!~sOm3!~dAyS!~L!f3~iS!~nOT!~bOriNg!!~
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 16.09.06 15:45 
Was soll denn deiner Meinung nach in den dlls drinstehen? Sorry, wenn ich so blöd frage, aber mir erscheint das unsinnig.

Natürlich sind Textdateien etwas "unprofessionell", vor allem deshalb, weil man die Informationen dichter packen könnte. Aber sonst?

Du kannst ja die Textdateien in .dll oder .dat umbenennen. ;-)

_________________
We are, we were and will not be.
LDMatrix17 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 73

xXpProOxsP2x
Flash5~Flash7 MX 2004 Prof.~Flash 8 Prof.~Delphi 7 prof.&HTML
BeitragVerfasst: Sa 16.09.06 15:47 
user profile iconGausi hat folgendes geschrieben:


Du kannst ja die Textdateien in .dll oder .dat umbenennen. ;-)


heyyyyyy!! ;) ;)
das wäre auch ne coole idee.. ;)

PS: ist Datenbank schwer??

_________________
~sOm3!~gUrLs!~sOm3!~dAyS!~L!f3~iS!~nOT!~bOriNg!!~