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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.