w2v-server: show frequency rank tooltips also for collocators
diff --git a/templates/index.html.ep b/templates/index.html.ep
index c9a2324..7270997 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -388,7 +388,8 @@
<%= sprintf("%.3e", $c->{sum}) %>
</td>
<td align="left">
- <a href="<%= url_with->query([word => $c->{word}]) =%>">
+ <a href="<%= url_with->query([word => $c->{word}]) =%>"
+ title="freq. rank: <%= $c->{rank} =%>">
<%= $c->{word} %>
</td>
% } else {
diff --git a/w2v-server.pl b/w2v-server.pl
index c76855c..c864774 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -777,6 +777,7 @@
SV* word = newSVpvf(&vocab[besti[a] * max_w], 0);
if(latin_enc == 0) SvUTF8_on(word);
hv_store(hash, "word", strlen("word"), word , 0);
+ hv_store(hash, "rank", strlen("rank"), newSVuv(besti[a]), 0);
hv_store(hash, "dist", strlen("dist"), newSVnv(bestd[a]), 0);
hv_store(hash, "norm", strlen("norm"), newSVnv(bestn[a]), 0);
hv_store(hash, "sum", strlen("sum"), newSVnv(target_sums[besti[a]]), 0);