Re: statistics of text

2005-11-02 Thread Brano Gerzo
Shawn Corey [SC], on Wednesday, November 02, 2005 at 10:59 (-0500) thoughtfully wrote the following: SC>next unless /\b$keyword\b/; # skip loop if no keyword yes, thats right, but in my case there will be *always* keyword on line :) Also thanks for all replies, nice examples. --

Re: statistics of text

2005-11-02 Thread John Doe
Ing. Branislav Gerzo am Mittwoch, 2. November 2005 14.52: > Hi all, > > I have quite interesting work. Example: > > In txt I have some words (up to 100.000) - words.txt (without line > numbers): > 1. foo > 2. bar > 3. foo bar > 4. foo bar bar > 5. bar foo bar > 6. bar bar foo > 7. foo foo bar > 8.

Re: statistics of text

2005-11-02 Thread Shawn Corey
Ing. Branislav Gerzo wrote: my $keyword = "business"; my %all2words = (); open TXT, "words.txt" or die $!; while () { chomp; next unless /\b$keyword\b/; # skip loop if no keyword while ( /(?=(\S+\s+\S+))\S+/g ) { my $temp = $1; $all2wo

Re: statistics of text

2005-11-02 Thread Shawn Corey
Ing. Branislav Gerzo wrote: I did this by hand...but anyone know how to this effectively in perl? I think I have to build hash of all possibilities of 2 words sentences (in input txt are allowed only [0-9a-z ]), in list I will have lines of input txt, and iterate every key in hash over array, wri

Re: statistics of text

2005-11-02 Thread Ing. Branislav Gerzo
Ricardo SIGNES [RS], on Wednesday, November 2, 2005 at 09:24 (-0500) wrote the following: RS> my %occurances; # we'll put occurances here RS> while (<>) {# get each line of argument files (or sdin) RS> chomp;# eliminate the newline RS> my @wo

Re: statistics of text

2005-11-02 Thread Ricardo SIGNES
* "Ing. Branislav Gerzo" <[EMAIL PROTECTED]> [2005-11-02T08:52:39] > I have quite interesting work. Example: I wish /I/ could find this sort of work interesting! Or profitable. > Now, I have to find all 2 words sentences with their sums in the list. > For example for this list it could be (witho

statistics of text

2005-11-02 Thread Ing. Branislav Gerzo
Hi all, I have quite interesting work. Example: In txt I have some words (up to 100.000) - words.txt (without line numbers): 1. foo 2. bar 3. foo bar 4. foo bar bar 5. bar foo bar 6. bar bar foo 7. foo foo bar 8. foo bar foo bar 9. foob bar 10.foo bars and so on... Now, I have to find all 2 wor