YAFZ has asked for the wisdom of the Perl Monks concerning the following question:
#! /usr/bin/perl while (<STDIN>) { s/(\d+)?([a-zA-ZıüğşçöİŞÖĞÜ]+\d+)+|( +\d+[a-zA-ZıüğşçöİŞÖĞÜ]+)//og; $MyString = $MyString . $_; } while ($MyString =~ /([a-zA-ZıüğşçöİŞÖĞÜ +]+)/og) { $temp = $1; $temp =~ tr/[A-Z]/[a-z]/; $MyWordCount{$temp}++; } print "Word\t\t\tFrequency\n"; print "======\t\t\t===========\n"; #sorting alphabetically foreach $key (sort keys %MyWordCount) { if (length($key) > 7) { print "$key\t\t$MyWordCount{$key}\n"; } else { print "$key\t\t\t$MyWordCount{$key}\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How much can this text processing be optimized?
by holli (Abbot) on May 16, 2005 at 13:59 UTC | |
by YAFZ (Pilgrim) on May 16, 2005 at 14:15 UTC | |
|
Re: How much can this text processing be optimized?
by ides (Deacon) on May 16, 2005 at 13:50 UTC | |
by YAFZ (Pilgrim) on May 16, 2005 at 14:13 UTC | |
|
Re: How much can this text processing be optimized?
by thundergnat (Deacon) on May 16, 2005 at 14:31 UTC | |
|
Re: How much can this text processing be optimized?
by mrborisguy (Hermit) on May 16, 2005 at 13:49 UTC | |
|
Re: How much can this text processing be optimized?
by Roger (Parson) on May 16, 2005 at 13:48 UTC |