Autor Beitrag
DL_Ricko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 55



BeitragVerfasst: So 29.03.09 00:55 
ich wollte gerne ein Programm schreiben schreiben das antwortend
also wenn man ein edit hat und man dar reinschreibt 'Hallo' das das denn antwortet auch mit hallo
aber ich habe keine Ahnung wie ich das machen kann :?: :?: :?:


Moderiert von user profile iconChristian S.: Topic aus Open Source Projekte verschoben am Sa 28.03.2009 um 23:57
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 29.03.09 01:15 
Hallo!

Wie komplex sollen die Antworten denn werden? Wie sind Deine Ideen dazu?

Ganz grob wäre ein simpler Ansatz dazu, bestimmte "Schlüsselworte" im Text zu suchen und in einer Datenbank sind mit diesen Schlüsselworten dann Antworten verbunden.

Grüße
Christian

P.S.: Bitte versteh das jetzt nicht falsch, aber könntest Du Dir bezüglich der Rechtschreibung ein bisschen mehr Mühe bei Deinen Beiträgen geben? Das ein oder andere Satzzeichen an der richtigen Stelle darf sich dann auch hinein verirren ;-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 29.03.09 01:16 
Im OnChange des Edit kannst du auf die Eingabe reagieren.
DL_Ricko Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 55



BeitragVerfasst: So 29.03.09 01:28 
wenn ich in ein edit schreibe "Hallo" und das den in die ListBox kommnt das weiß ich mit
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
  ListBox1.Items.Add(Edit1.Text);
end;

und wenn in dieser ListBox1 steht hallo denn scholl der PC in die listBox1 rein schreiben hallo auch.
FinnO
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1331
Erhaltene Danke: 123

Mac OSX, Arch
TypeScript (Webstorm), Kotlin, Clojure (IDEA), Golang (VSCode)
BeitragVerfasst: So 29.03.09 09:40 
also ganz grob mit IF und THEN :D

ausblenden Delphi-Quelltext
1:
2:
if trim( uppercase(Text) ) = 'HALLO' then
  Showmessage('Hallo auch!');
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: So 29.03.09 12:00 
Also ich zweifele ehrlich gesagt am Sinn von so einem Programm. Das wäre ja nicht das erste seiner Art, und funktioniert hat noch keins. :roll:
wazap
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 25



BeitragVerfasst: So 29.03.09 13:12 
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:
function CaseOfString(const Text: string; Strings: array of string): Integer;
begin
  Result := 0;

  while (Result < Length(Strings)) and (Strings[Result] <> Text) do
    Inc(Result);

  if Strings[Result] <> Text then
    Result := -1;
end;

function ReagiereAufText(const Text: string): string;
begin
  Result := '';

  case CaseOfString(Trim(LowerCase(Text)), ['hallo''tschüss']) of
    0: Result := 'Guten Tag!';
    1: Result := 'Machs Gut!';

    else Result := 'Tut mir leid, ich hab Sie leider nicht verstanden!';
  end;
end;

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
  begin
    Memo1.Lines.Add(Edit1.Text);
    Memo1.Lines.Add(ReagiereAufText(Edit1.Text));

    Edit1.Text := '';
  end;
end;


Ich würds so probieren!
j.klugmann
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 29.03.09 13:13 
Och , zum Üben ist so etwas doch ganz wichtig.Besonders wenn man Anfänger ist , kann man so gut lernen. ;)
DL_Ricko Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 55



BeitragVerfasst: So 29.03.09 14:43 
was bedeutet
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
function CaseOfString(const Text: string; Strings: array of string): Integer;
begin
  Result := 0;

  while (Result < Length(Strings)) and (Strings[Result] <> Text) do
    Inc(Result);

  if Strings[Result] <> Text then
    Result := -1;
end;

ich verste das nicht
wazap
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 25



BeitragVerfasst: So 29.03.09 15:12 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
case CaseOfString(Text, ['Hallo''Guten Tag''Bye']) of // Hallo=0; Guten Tag=1 und Bye=2
  0// Wenn Text = "Hallo" dann...
  1// Wenn Text = "Guten Tag" dann...
  2// Wenn Text = "Bye" dann...
end;
Ich hoff du hast es verstanden, bin nich so im erklären :D

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 29.03.09 15:15 
Das sollte wohl einiges erklären.
www.christian-stelzm...rtikel/crashkurs.htm
DL_Ricko Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 55



BeitragVerfasst: So 29.03.09 15:26 
so jetzt habe Ich Verstanden denke an alle.

kann man das auch mit ner ListBox.
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: So 29.03.09 16:09 
ja.
Fiete
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 618
Erhaltene Danke: 365

W7
Delphi 6 pro
BeitragVerfasst: Mo 30.03.09 18:43 
Moin DL_Ricko,
versuchs mal hier: de.wikipedia.org/wiki/ELIZA

Gruß
Fiete

_________________
Fietes Gesetz: use your brain (THINK)