/* declaring externally defined rank class structures */
/* remember to install rank classes in zebraapi.c as well!! */
extern struct rank_control *rank_1_class;
+extern struct rank_control *rank_2_class;
extern struct rank_control *rank_zv_class;
extern struct rank_control *rank_static_class;
extern struct rank_control *rank_similarity_class;
* score should be between 0 and 1000. If score cannot be obtained
* -1 should be returned.
*/
-static int calc(void *set_handle, zint sysno, zint staticrank,
- int *stop_flag)
+static int calc_1(void *set_handle, zint sysno, zint staticrank,
+ int *stop_flag)
{
int i, lo, divisor, score = 0;
struct rank_set_info *si = (struct rank_set_info *) set_handle;
return score;
}
+static int calc_2(void *set_handle, zint sysno, zint staticrank,
+ int *stop_flag)
+{
+ int score = calc_1(set_handle, sysno, staticrank, stop_flag);
+ return score - staticrank;
+}
+
/*
* Pseudo-meta code with sequence of calls as they occur in a
* server. Handlers are prefixed by --:
* server close
*/
-static struct rank_control rank_control = {
+static struct rank_control rank_1_control = {
"rank-1",
create,
destroy,
begin,
end,
- calc,
+ calc_1,
+ add,
+};
+struct rank_control *rank_1_class = &rank_1_control;
+
+static struct rank_control rank_2_control = {
+ "rank-2",
+ create,
+ destroy,
+ begin,
+ end,
+ calc_2,
add,
};
-struct rank_control *rank_1_class = &rank_control;
+struct rank_control *rank_2_class = &rank_2_control;
/*
* Local variables:
* c-basic-offset: 4
/* installing rank classes */
zebraRankInstall(reg, rank_1_class);
+ zebraRankInstall(reg, rank_2_class);
zebraRankInstall(reg, rank_similarity_class);
zebraRankInstall(reg, rank_static_class);
<xsl:param name="snippet" select="''"/>
<xsl:param name="score" select="''"/>
<xsl:param name="id" select="''"/>
+<xsl:param name="rank" select="''"/>
<xsl:output indent="yes"
method="xml"
version="1.0"
<snippet>
<id><xsl:value-of select="$id"/></id>
<score><xsl:value-of select="$score"/></score>
+ <rank><xsl:value-of select="$rank"/></rank>
<xsl:copy-of select="$snippet"/>
</snippet>
</xsl:template>