Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Is it possible to find the matching words and the percentage of matching words between two texts?

by McDarren (Abbot)
on Dec 21, 2012 at 08:48 UTC ( #1009889=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %foo;
    my $string = 'Poet Blake had a milky white cat. He used to call it Pus
    +sy.';
    for my $word (split /\s+/, $string) {
       $foo{$word}++;
    }
    
  2. or download this
    my $cnt;
    for my $word (keys %foo) {
        $cnt++ if $bar{$word};
    }
    
  3. or download this
    my $word_count = scalar keys %foo;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009889]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-03-22 23:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (278 votes). Check out past polls.