git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
browser: tweak and update support scores
[sheet.git]
/
browser.plp
diff --git
a/browser.plp
b/browser.plp
index 04599d01b14377465b285b8b0df3b645e17e08c9..85ee802e046a8efcd99992694e3541a2f2ab186c 100644
(file)
--- a/
browser.plp
+++ b/
browser.plp
@@
-61,6
+61,12
@@
my %DSTATS = (
);
},
);
);
},
);
+my %PSTATS = ( # score percentage
+ y => 1, 'y x' => .9,
+ a => .5, 'a x' => .5, 'a d' => .1,
+ j => .2, 'p j' => .2, 'n d' => .2, 'n x d' => .2,
+ p => .2, 'p p' => .2, 'p d' => .1,
+);
my %CSTATUS = (
unoff => 'l1', # unofficial
wd => 'l2', # draft
my %CSTATUS = (
unoff => 'l1', # unofficial
wd => 'l2', # draft
@@
-257,14
+263,13
@@
say '</tfoot>';
sub featurescore {
# relative amount of support for given feature
sub featurescore {
# relative amount of support for given feature
- state $statspts = { y=>1, 'y x'=>1, a=>.5, 'a x'=>.5, j=>.2, 'p j'=>.2, 'p p'=>.2, p=>.1 };
my $rank = 0;
if (my $row = shift) {
if ($canihas) {
while (my ($browser, $versions) = each %$row) {
ref $versions eq 'HASH' or next;
while (my ($version, $_) = each %$versions) {
my $rank = 0;
if (my $row = shift) {
if ($canihas) {
while (my ($browser, $versions) = each %$row) {
ref $versions eq 'HASH' or next;
while (my ($version, $_) = each %$versions) {
- $rank += ($canihas->{$browser}->{$version} || .001) * $
statspts->
{$_};
+ $rank += ($canihas->{$browser}->{$version} || .001) * $
PSTATS
{$_};
}
}
return $rank;
}
}
return $rank;
@@
-282,7
+287,7
@@
sub featurescore {
}
splice @vers, -1, 0, @future; # move ahead to decrease precedence
}
}
splice @vers, -1, 0, @future; # move ahead to decrease precedence
}
- $rank += $
statspts->
{$_} * 2**($div--) for reverse @vers;
+ $rank += $
PSTATS
{$_} * 2**($div--) for reverse @vers;
}
}
return $rank;
}
}
return $rank;