Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

menth0l:

Well, the recommended approach is to first visit CPAN to see what bits you can leverage. A couple simple searches based on interesting words in your requirements should lead you to some potentially-useful modules:

Search Term(s) Module Notes
stem WordNet::Similarity It has a stem module
scan text Text::Scan Claims: "Fast search for very large numbers of keys in a body of text." and the synopsis shows an example of using it to count words.
ranking Tie::Hash::Rank Hmmm... this looks interesting. I'll have to install and check this one out.

Then you should review the module(s). You need to find out which one(s) are suitable to your needs, and determine what capabilities they have. You'll want to write a couple "try it out" scripts to verify that the modules work the way you expect them to and get a feel for how to use them.

Next, you can design your script by figuring out a rough skeleton of how to accomplish the job you want to do. Keep in mind the capabilities of the module(s) you've selected, so you can leverage them as much as possible. During this stage, be sure to generate some test cases and determine what you want the output to be. That'll give you a way to test your code and can help prevent running around in circles changing the output layout, etc.

Finally, write/test/debug your script.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Update: Filled in lower-right cell, repaired broken HTML.


In reply to Re: Module for text/phrase ranking by roboticus
in thread Module for text/phrase ranking by menth0l

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 contemplating the Monastery: (4)
As of 2024-04-19 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found