2 # Analyzing DBC's example queries
3 # Step 3: Eliminate search terms
4 # Assumes x3 is the result of process2.pl
5 # Result should be sorted and passed to the next step
8 open F, "x3" or die "could not open x3: $!\n";
16 #last if ($linecount >10);
17 my ( $hits, $query) = split (';');
20 #print "$_ : '$query'\n";
22 for my $t ( split(' ',$query) ) {
24 if ( $t ne "og" && $t ne "eller" && $t ne "ikke" ) {
30 $counts{$nq} = 0 unless defined($counts{$nq});
31 $counts{$nq} += $hits;
32 print "$nq: $hits $counts{$nq}\n";
36 open OUT, ">x5" or die "could not open sort>x5 for writing: $!\n";
39 for my $q ( sort { $counts{$b} <=> $counts{$a} } keys(%counts) ) {
40 print "q='$q' n=$counts{$q} \n";
41 print OUT "$counts{$q}; $q\n";