Diff for /loncom/interface/loncommon.pm between versions 1.428 and 1.429

version 1.428, 2006/07/14 17:23:49 version 1.429, 2006/07/17 19:47:20
Line 1918  sub get_related_words { Line 1918  sub get_related_words {
         return ();          return ();
     }       } 
     my @Words=();      my @Words=();
       my $count=0;
     if (exists($thesaurus_db{$keyword})) {      if (exists($thesaurus_db{$keyword})) {
  # The first element is the number of times   # The first element is the number of times
  # the word appears.  We do not need it now.   # the word appears.  We do not need it now.
  (undef,@Words) = (split(/:/,$thesaurus_db{$keyword}));   my (undef,@RelatedWords) = (split(/:/,$thesaurus_db{$keyword}));
         for (my $i=0;$i<=$#Words;$i++) {   my (undef,$mostfrequentcount)=split(/\,/,$RelatedWords[0]);
             ($Words[$i],undef)= split(/\,/,$Words[$i]);   my $threshold=$mostfrequentcount/10;
           foreach my $possibleword (@RelatedWords) {
               my ($word,$wordcount)=split(/\,/,$possibleword);
               if ($wordcount>$threshold) {
    push(@Words,$word);
                   $count++;
                   if ($count>10) { last; }
       }
         }          }
     }      }
     untie %thesaurus_db;      untie %thesaurus_db;

Removed from v.1.428  
changed lines
  Added in v.1.429


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>