Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: count trigrams of a whole file

by frozenwithjoy (Priest)
on Dec 20, 2012 at 08:50 UTC ( #1009704=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (<>) {
        push @words, split /\s/;
    }
    
  2. or download this
    trigram frequencies in your text:
    iwentthere! 1
    ...
    there!shealso 1
    shealsowent 1
    alsowentthere. 1
    
  3. or download this
    @trigrams = ();
    
    ...
        print "$trigrams[$index] $trigramfrequency[$index]\n";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009704]
help
Chatterbox?
[Discipulus]: Thou?!?
[Discipulus]: why you missed the opportunity of telling from singular and plural? you had it..

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-11-23 11:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (333 votes). Check out past polls.

    Notices?