Leen
Leen

Reputation:

simple search engine

I am trying to write program its like a simple search engine, in this program the user is supposed to enter a search keyword into an edit box and then he can click the search button, and the program is supposed to open a specific text file from the directory and find a matching word to that keyword in this text file. I am using Delphi 2007. thank you

Upvotes: 1

Views: 960

Answers (4)

skamradt
skamradt

Reputation: 15548

You might want to look at the source code for the open source project GExperts. It contains a text search engine (grep) that works very well.

Upvotes: 1

hashable
hashable

Reputation: 3851

If you are on a unix system, send a call to grep. If you are on a windows system, install grep for windows.

Upvotes: 1

Conceptdev
Conceptdev

Reputation: 3261

I have written something similar in C# - Searcharoo.net - you can download the source code from there.

What might be more useful, though, are the articles that I wrote describing how it works... This description of how Version 1 might be of some use - although I'm probably biased since I wrote it (back in 2004).

Your question is pretty open so I'm not sure if this will help - particularly since I don't know Delphi and how different it is to C# - but hope it helps...

Upvotes: 0

stribika
stribika

Reputation: 3176

Basically you need to find a string in another string. Take a look at this algorithm: http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm

Upvotes: 1

Related Questions