Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi No-Lifer!

One way to go about this is to first build a list of keywords and then all you need do is a lookup.

You could use HTML::TokeParser to extract the text from each page and something like this to extract the words (what are your plans for common words, accents, hypens, numbers etc.?).

Then load the words into a DB (I use DBM::Deep) with a reference to each file that contains each word (I use another D::D for the file refs).

All you have to bear in mind is to apply the same rules to the words submitted as you did when you built the index.

Then perhaps HTML::Template to format the results and CGI::Session to display them a page at a time.

At the moment I build the index locally and upload it. There are about 2k pages and the index comes in at a shade under 42k words (12MB). And, fingers crossed, it's working well.

I would be interested in seeing an outline of how you plan to go about this. We may be able to make some suggestions before you commit yourself to any particular strategy.

Good luck!

After writing this I saw your reply to Limbic~Region. My advice above still stands.


In reply to Re: Form validation/Search script by wfsp
in thread Form validation/Search script by No-Lifer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-25 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found