#-*-Mode: perl;-*- eval "\$opt_$1=\$2" while $ARGV[0] =~ /^(\w+)=(.*)/ && shift; print "
Words are from the Random House Dictionary, 2nd ed. Word frequencies are weighted by the frequencies in the Brown corpus (Francis & Kucera). Deviations are (O - E)^2 / E, deriving the expectation from the frequencies of the vowel and of the coda sequence among observed codas. We report only rimes that have an expected frequency of 5 or more. Frequencies are not weighted by word frequency. "; if (defined($opt_collapse)) { printf("
Treating vowels $opt_collapse as A\n"); } if (defined($opt_zero)) { printf("
Counting 0 freqs in Brown as $opt_zero\n");
}
$vowels = "aAcCeEioORuUVWyY";
$nTypes = 0;
$nTokens = 0;
while ($line = This report was generated by
a Perl programme.
";
\n";
sub smallest {
$smallest = 100000;
for $num (@_) {
if ($num < $smallest) {$smallest = $num;}
}
$smallest;
}
sub numerically {
($aNum) = split(/ /, $a);
($bNum) = split(/ /, $b);
$aNum <=> $bNum;
}
sub eg {
local(*table, $key) = @_;
if (!defined($table{$key})) {$table{$key} = $sp;}
else {
$examples = "$table{$key},$sp";
if (length($examples) < 50) {$table{$key} = $examples;}
}
}
sub bump {
local(*table, $key, $value) = @_;
if (defined($table{$key})) {
$table{$key} += $value;
}
else {
$table{$key} = $value;
}
}
print "
";
for $line (@devs) {
($dev, $rime, $expect) = split(/ /, $line);
printf("Dev Rime Observed Expected Examples \n",
$dev, $rime, $rimefreqtypes{$rime}, $expect);
}
print "%.2f %s %d %.2f $rimeeg{$rime}