experimental implementation of a citation ranking as post-ranking

method. (ranking coefficient fixed, need to be made configurable)
pull/1/head
Michael Christen 13 years ago
parent 8f89c8ef07
commit ac5d124ee0

@ -306,6 +306,10 @@ public class SnippetProcess {
r += rentry.lapp() << this.query.ranking.coeff_cathasapp;
}
// apply citation count
//System.out.println("POSTRANKING CITATION: references = " + rentry.referencesCount() + ", inbound = " + rentry.llocal() + ", outbound = " + rentry.lother());
r += (128 * rentry.referencesCount() / (1 + 2 * rentry.llocal() + rentry.lother())) << 8;
// prefer hit with 'prefer' pattern
if (this.query.prefer.matcher(rentry.url().toNormalform(true, true)).matches()) {
r += 256 << this.query.ranking.coeff_prefer;

@ -55,6 +55,7 @@ public class ResultEntry implements Comparable<ResultEntry>, Comparator<ResultEn
private String alternative_urlname;
private final TextSnippet textSnippet;
private final List<MediaSnippet> mediaSnippets;
private final Segment indexSegment;
// statistic objects
public long dbRetrievalTime, snippetComputationTime, ranking;
@ -66,6 +67,7 @@ public class ResultEntry implements Comparable<ResultEntry>, Comparator<ResultEn
final List<MediaSnippet> mediaSnippets,
final long dbRetrievalTime, final long snippetComputationTime) {
this.urlentry = urlentry;
this.indexSegment = indexSegment;
this.alternative_urlstring = null;
this.alternative_urlname = null;
this.textSnippet = textSnippet;
@ -155,6 +157,15 @@ public class ResultEntry implements Comparable<ResultEntry>, Comparator<ResultEn
public int filesize() {
return this.urlentry.size();
}
public int referencesCount() {
return this.indexSegment.urlCitation().count(this.urlentry.hash());
}
public int llocal() {
return this.urlentry.llocal();
}
public int lother() {
return this.urlentry.lother();
}
public int limage() {
return this.urlentry.limage();
}

Loading…
Cancel
Save