Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: calculate matching words/sentence

by benn (Vicar)
on Sep 05, 2003 at 00:55 UTC ( #289072=note: print w/replies, xml ) Need Help??


in reply to calculate matching words/sentence

The modules given above (and some others in the Lingua:: namespace as well) will give you the similarity in terms of 'raw words', but that's it. Attempting to derive meaning - 'the same information, told multiple ways' - is another matter altogether, as evidenced by the fact that your two example sentences do *not* say the same thing...in one, the fox jumps over the dogs while in the other, it's the dogs who are jumping.

Something like Lingua::LinkParser could help you here. POS analysis would allow you to spot the similarities between "The fox jumped over the dog" and "The dog was jumped over by the fox". More work than simple text matching, but better for reducing the eventual size of the database.

Cheers, Ben.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://289072]
help
Chatterbox?
[marioroy]: Thanks Lady_Aleena. I learned another thing today.
[marioroy]: I've always wondered the shortcut for metamod verus mod. It's simply metamod when making a link.
[Lady_Aleena]: You're welcome marioroy. There are a whole lot of linking shortcuts.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-05-24 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?