in reply to Module for text/phrase ranking

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.