--- db/prgsrc/eq/Attic/findequal.pl 2001/08/04 11:41:50 1.10 +++ db/prgsrc/eq/Attic/findequal.pl 2001/11/25 23:40:27 1.11 @@ -66,7 +66,7 @@ print "Creating equalto table...\n"; if ((uc 'Á') ne 'á') {die "!Koi8-r locale not installed!\n"}; print "before getbase"; -getbase(QuestionId,Question); +getbase(QuestionId,Question,Authors,Comments); print "after getbase"; @@ -75,7 +75,7 @@ print "Loading questions...\n"; if ((uc 'Á') ne 'á') {die "!Koi8-r locale not installed!\n"}; -while ((($id, $a) = getrow), $id) +while ((($id, $a,$author,$comment) = getrow), $id) { if (!($id%1000)) {print "$id questions loaded...\n"} @@ -84,6 +84,7 @@ while ((($id, $a) = getrow), $id) $a=~s/[^êãõëåîçûýúèÿüöäìïòðá÷ùæñþóíéôøâàÊÃÕËÅÎÇÛÝÚÈßÆÙ×ÁÐÒÏÌÄÖÜÑÞÓÍÉÔØÂÀ]//g; $ar[$id]=$a; + $dop[$id]= ($author ? 2 : 0) + ($comment ? 1 : 0); $last=$id; } @@ -93,7 +94,7 @@ print "Checking...\n"; $cur=0; $ar[0]="\0"; -foreach $q (sort {($ar[$a] cmp $ar[$b])} 1..$last) +foreach $q (sort {($ar[$a] cmp $ar[$b]) || ($dop[$b]<=>$dop[$a])} 1..$last) { if ($ar[$q] eq $ar[$cur]) {$equal{$q}=$cur} else {$cur=$q} }