Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
neigh.pl
open(my $IN,"./misspell.txt"); open(my $INN,"./correct.txt"); open(my $fh, '>', 'NeighbourhoodReport.txt'); $tokenCnt = 0; $corr = 0; $TokenMatch = 0; my $start_run=time(); print $fh "Neighbourhood Search report\n"; while ($token=<$IN>, $canon=<$INN>) { chomp($token); chomp($canon); $result = `agrep -1 \"^${token}\$" ./dict.txt `; chomp($result); $tokenCnt++; print $fh "${result}\n"; if ($result eq $canon) { $corr++; } } close($IN); my $end_run = time(); my $run_time = $end_run - $start_run; print $fh "Correct: ${corr} in a total of ${tokenCnt}\n"; print $fh "Execution Time : ${run_time}";
run
|
edit
|
history
|
help
0
hashes
palindromic dates
Array_with_unshift_function
XPPErrorLog
Hash-Nevil
Hash
doctor
taller in front
Leonardo Numbers
5_5