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

www www at source.lon-capa.org
Thu Sep 15 17:17:49 EDT 2011


www		Thu Sep 15 21:17:49 2011 EDT

  Modified files:              
    /modules/gerd/harvesting	finalize.pl 
  Log:
  First round of taxonomy work done.
  
  
Index: modules/gerd/harvesting/finalize.pl
diff -u modules/gerd/harvesting/finalize.pl:1.2 modules/gerd/harvesting/finalize.pl:1.3
--- modules/gerd/harvesting/finalize.pl:1.2	Thu Sep 15 18:40:39 2011
+++ modules/gerd/harvesting/finalize.pl	Thu Sep 15 21:17:48 2011
@@ -18,7 +18,7 @@
          $lev3{$levels[0].':'.$levels[1].':'.$levels[2]}+=$cnt;
       }
    }
-   print "------ $tax\n";
+#   print "------ $tax\n";
 
 
 
@@ -27,7 +27,7 @@
    my $t3=0;
    my $win3='';
    foreach my $le3 (sort(keys(%lev3))) {
-      print $le3."\t".$lev3{$le3}."\n";
+#      print $le3."\t".$lev3{$le3}."\n";
       $t3+=$lev3{$le3};
    }
    foreach my $le3 (sort(keys(%lev3))) {
@@ -41,7 +41,7 @@
    my $t2=0;
    my $win2='';
    foreach my $le2 (sort(keys(%lev2))) {
-      print $le2."\t".$lev2{$le2}."\n";
+#      print $le2."\t".$lev2{$le2}."\n";
       $t2+=$lev2{$le2};
    }
    foreach my $le2 (sort(keys(%lev2))) {
@@ -56,7 +56,7 @@
    my $t1=0;
    my $win1='';
    foreach my $le1 (sort(keys(%lev1))) {
-      print $le1."\t".$lev1{$le1}."\n";
+#      print $le1."\t".$lev1{$le1}."\n";
       $t1+=$lev1{$le1};
    }
    foreach my $le1 (sort(keys(%lev1))) {
@@ -64,6 +64,12 @@
          $win1=$le1;
       }
    }
-   print "WIN: $win3, $win2, $win1\n";
+   if (($win2) && ($win2=~/^$win1/)) { undef($win1); }
+   if (($win3) && ($win3=~/^$win2/)) { undef($win2); }
+   my @winners=();
+   foreach my $win ($win1,$win2,$win3) {
+      if ($win) { push(@winners,$win); }
+   }
+   print $idx."\t".join(',', at winners)."\n";
 }
 close(IN);




More information about the LON-CAPA-cvs mailing list