Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
hello monks,
I want to comapre 2 strings and extract the longest common substring based on words.
I have used
my $seg1 = "The man who likes reading books and writing poems." <p>my $seg1 = "The man who likes reading big books and poems." <p>lcss( "$seg1", "$seg2" );
but the result is based on strings. The output is:
The man who likes reading b
Is any algorithm in perl that returns
The man who likes reading?
I would be also happy having sommethins like:
The man who likes reading * * * poems
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Find substring based on words and not in charachters
by Corion (Patriarch) on Dec 02, 2014 at 16:14 UTC | |
|
Re: Find substring based on words and not in charachters (Updated.)
by BrowserUk (Patriarch) on Dec 02, 2014 at 17:06 UTC | |
by choroba (Cardinal) on Dec 02, 2014 at 17:16 UTC | |
by BrowserUk (Patriarch) on Dec 02, 2014 at 17:22 UTC | |
by GotToBTru (Prior) on Dec 02, 2014 at 20:40 UTC | |
by Anonymous Monk on Dec 03, 2014 at 09:20 UTC |