in reply to Theory time: Sentence equivalence
While the name doesn't suggest being useful, you might find Lingua::LinkParser beneficial. It not only parses sentences, but also identifies each word's role in the sentence -- or how the words link together. Thus, you'll know a sentence about the "dog days of summer" isn't about dogs. You can read a detailed intro here.
The module (the core of which integrates with C code that you install separately), generates data structures that break a sentence down into component parts, though there's a bit of work you' have to do to wade through all the types it lists. Here's a short example (the module has docs for all of those link types):
use Lingua::LinkParser; use strict; my $parser = new Lingua::LinkParser; # create the parser my $text = "Moses supposes his toses are roses."; my $sentence = $parser->create_sentence($text); # parse the sentence my $linkage = $sentence->linkage(1); # use the first linkage print $parser->get_diagram($linkage); # print it out __END__ +-------------------------Xp------------------------+ | +------Ce------+ | +---Wd--+---Ss---+ +--Dmc--+--Spx--+--Opt-+ | | | | | | | | | LEFT-WALL Moses supposes.v his toses[!].n are.v roses.n .
Cheers,
Ovid
New address of my CGI Course.
|
|---|