[LON-CAPA-cvs] cvs: modules /gerd/harvesting nonword.pl

www www at source.lon-capa.org
Tue Sep 13 10:49:24 EDT 2011


www		Tue Sep 13 14:49:24 2011 EDT

  Added files:                 
    /modules/gerd/harvesting	nonword.pl 
  Log:
  Collect un_keywords
  
  

Index: modules/gerd/harvesting/nonword.pl
+++ modules/gerd/harvesting/nonword.pl
use strict;
my %un=();
open(IN,'keywords.dat');
while (my $line=<IN>) {
   chomp($line);
   my ($idx,$word)=split(/\t/,$line);
   print $word."> ";
   my $reply=<STDIN>;
   if ($reply=~/y/i) {
      $un{$word}=1;
   }
   if ($reply=~/q/i) {
      last;
   }
}
close(IN);
open(OUT,">>nonwords.dat");
foreach my $key (keys(%un)) {
   print OUT $key."\n";
}
close(OUT);




More information about the LON-CAPA-cvs mailing list