Autor Beitrag
gerd8888
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 205
Erhaltene Danke: 3

Win7
Delphi 10.1 Starter (kostenlos) Lazarus
BeitragVerfasst: Di 31.05.11 00:29 
Hi,

gibt es vielleicht schon eine Suchmaschine, die in einem String-Text nach vielen Schlüsselwörter suchen kann.

Beispiel 1:
(Wort1 AND Wort2) OR Wort3

Beispiel 2:
(Wort1 OR Wort2 OR Wort3) And (Wort4 OR Wort5)

usw.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 31.05.11 00:32 
Moin!

Meinst du reguläre Ausdrücke? :gruebel: Da ist aber die Syntax anders. :nixweiss: Und für welche Sprache darf´s denn sein. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Di 31.05.11 10:32 
user profile icongerd8888 hat folgendes geschrieben Zum zitierten Posting springen:
(Wort1 AND Wort2) OR Wort3
(Wort1 OR Wort2 OR Wort3) And (Wort4 OR Wort5)


Ja, die gibt es. *g*

en.wikipedia.org/wik...earch#Search_options

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Di 31.05.11 11:24 
Meinst du sowas?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
const
  Wort1 = 'Blubb';
  Wort2 = 'Hallo';
  Wort3 = 'Text';
  Wort4 = 'Bye';
var
  s: String;
begin
  s := 'Mein Text................';

  if ((pos(Wort1, s) > 0and (pos(Wort2, s) > 0)) or (pos(Wort3, s) > 0then
    ShowMessage('Wörter gefunden...');
end;


Suche in der Entwickler-Ecke POS
Suche in der Entwickler-Ecke POSEX
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 31.05.11 12:51 
Wenn man einen Text nach vielen Wörtern gleichzeitig durchsuchen möchte, ohne ständig den gesamten Text für jedes Wort aufs neue zu untersuchen (wie das user profile iconAndreas L. vorschlägt), dann gibt es Algorithmen dafür, z.B. den von Wu-Manber. Dazu hab ich in diesem Topic mal was gepostet, oder halt auf meiner Webseite. :D

Eine komplexere Suche wie (w1 or w2 or w3) AND (w4 or w5) ist damit nicht direkt möglich - das ist eher was für (w1 or w2 or w3 or ... or w100) ;-)

_________________
We are, we were and will not be.
gerd8888 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 205
Erhaltene Danke: 3

Win7
Delphi 10.1 Starter (kostenlos) Lazarus
BeitragVerfasst: Mi 01.06.11 13:30 
ausblenden Delphi-Quelltext
1:
2:
if ((pos(Wort1, s) > 0and (pos(Wort2, s) > 0)) or (pos(Wort3, s) > 0then
    ShowMessage('Wörter gefunden...');


Ja, nur geht das jetzt nur auf einen Fall bezogen.
Ich habe z.B. in einem TEdit1 eine komplexe Suche, die Klammern beinhaltet.
D.h. man muesste dann fuer diese Art Suche die Klammern berücksichtigen usw.

Aber ich wollte im Grunde nur wissen, ob es sowas schon gibt. Anscheinend nicht. Ich selbst brauche es auch nicht unbedingt.
Mir reicht eine Suche mit Or oder AND voellig aus.

Wu-Manber: interessant, habe mir es gerade angesehen. Das will ich mal ausprobieren...

Gerd
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Mi 01.06.11 13:39 
Wenn ich deine Frage oben nicht beantwortet habe, habe ich sie wahrscheinlich falsch verstanden: Du meinst doch so etwas, oder? www.google.de/search...ND+(forum+OR+praxis)

user profile icongerd8888 hat folgendes geschrieben Zum zitierten Posting springen:
gibt es eine Suchmaschine, die in einem String-Text nach vielen Schlüsselwörter suchen kann?
Genau das implementiert doch schon Google und eigentlich jede andere Suchmaschine, die ich kenne. Oder meinst du gar keine Suchmaschine, sondern einen Algorithmus in Delphi oder einer anderen Sprache, wie ihn user profile iconAndreas L. angesprochen hat?

lg,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)