[Debtags-commits] [svn] r1444 -
central-database/branches/alioth/webfrontend
Enrico Zini
enrico at costa.debian.org
Sun Oct 30 17:07:40 UTC 2005
Author: enrico
Date: Sun Oct 30 17:07:39 2005
New Revision: 1444
Modified:
central-database/branches/alioth/webfrontend/Engine.pm
central-database/branches/alioth/webfrontend/index.cgi
Log:
Ignore unfaceted tags
Removed the old commented out navigation algorithm (we can always pick it up from a previous svn version)
Modified: central-database/branches/alioth/webfrontend/Engine.pm
==============================================================================
--- central-database/branches/alioth/webfrontend/Engine.pm (original)
+++ central-database/branches/alioth/webfrontend/Engine.pm Sun Oct 30 17:07:39 2005
@@ -573,7 +573,7 @@
# one we just read
my %first = map { $_->{name} => 1 } @{$dbp->{tags}};
- my %second = map { $_ => 1 } split(', ', ($tags or ''));
+ my %second = map { $_ => 1 } grep { exists $tags{$_} } split(', ', ($tags or ''));
my %union = map { $_ => 1 } ( keys %first, keys %second );
my (@added, @deleted);
Modified: central-database/branches/alioth/webfrontend/index.cgi
==============================================================================
--- central-database/branches/alioth/webfrontend/index.cgi (original)
+++ central-database/branches/alioth/webfrontend/index.cgi Sun Oct 30 17:07:39 2005
@@ -202,88 +202,10 @@
}
}
-#my %work_stats = %tag_counts;
-#
-## Get the facet with the higher cardinality
-#sub best_facet ()
-#{
-# my %fstats;
-# for my $tag (keys %work_stats)
-# {
-# $fstats{facet($tag)} += $work_stats{$tag};
-# }
-# my $max = 0;
-# my $maxfac;
-# while (my ($fac, $n) = each %fstats)
-# {
-# if ($n > $max)
-# {
-# $max = $n;
-# $maxfac = $fac;
-# }
-# }
-# return $maxfac;
-#}
-#
-## Remove all tags belonging to this facet, and all packages tagged with tags in
-## this facet, from the working set. Returns the list of tags removed.
-#sub detach_facet ($)
-#{
-# my ($facet) = @_;
-#
-# my @tags = grep { facet($_) eq $facet } keys %work_stats;
-# for my $tag (@tags)
-# {
-# delete $work_stats{$tag};
-# }
-#
-# # Remove uninteresting packages
-# for (my $i = 0; $i < @pkgs; )
-# {
-# if (intersects($pkgs[$i], @tags))
-# {
-# if ($i == $#pkgs)
-# {
-# pop(@pkgs);
-# } else {
-# $pkgs[$i] = pop(@pkgs);
-# }
-# } else {
-# $i++;
-# }
-# }
-#
-# return @tags;
-#}
-#
-##printf STDERR "BEGIN %d\n", scalar(keys(%work_stats));
-#my $i = 0;
-#while (scalar keys %work_stats > $packages_limit)
-#{
-# my $facet = best_facet();
-# my @tags = detach_facet($facet);
-#
-## msg("Selected %s, %d items, %d remaining\n", $facet, scalar @tags, scalar keys %work_stats);
-#
-# push @tag_newtags, @tags;
-# ++$i;
-#}
-
-#msg("Done. %d tags, %d packages, %d iterations.\n", scalar(@tag_newtags), scalar @pkgs, $i);
-
-
##
## Output results
##
-# Build a list of all known tags
-#my %tag_desc;
-#for my $tag (Engine::tags())
-#{
-# my $t = Engine::getTag($tag);
-# $tag_desc{$tag} = $t->{sdesc};
-#}
-
## Build HTML::Template data structures
# Currently selected tags
More information about the Debtags-commits
mailing list