mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 13:09:00 +00:00
Merge pull request 'Test rewarding linked terms.' (#73) from master into release
Reviewed-on: https://git.marginalia.nu/marginalia/marginalia.nu/pulls/73
This commit is contained in:
commit
3b6d582666
@ -40,12 +40,8 @@ public class SearchResultValuator {
|
|||||||
double factorSum = 0.;
|
double factorSum = 0.;
|
||||||
|
|
||||||
for (int i = 0; i < scores.length; i++) {
|
for (int i = 0; i < scores.length; i++) {
|
||||||
final double factorBase;
|
|
||||||
|
|
||||||
if (scores[i].link) factorBase = 0.5;
|
final double factor = 1. / (1.0 + weights[i]);
|
||||||
else factorBase = 1.;
|
|
||||||
|
|
||||||
final double factor = factorBase / (1.0 + weights[i]);
|
|
||||||
|
|
||||||
factorSum += factor;
|
factorSum += factor;
|
||||||
|
|
||||||
@ -54,6 +50,9 @@ public class SearchResultValuator {
|
|||||||
if (!scores[i].link && !scores[i].title) {
|
if (!scores[i].link && !scores[i].title) {
|
||||||
termValue *= lengthPenalty;
|
termValue *= lengthPenalty;
|
||||||
}
|
}
|
||||||
|
if (scores[i].link) {
|
||||||
|
termValue /= 2;
|
||||||
|
}
|
||||||
|
|
||||||
termSum += termValue;
|
termSum += termValue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user