I have the following Xquery
code:
for $w in $words
let $freq := (count($corpus[. eq $w]) div count($content2[text() eq $w]))
order by $freq descending
return <tr><td>{$w}</td><td>{$freq}</td></tr>
$words
is some distinct words that appears (may appear multiple times) in $corpus
. $content2
is some another bag of words. Variables and division is not that important.
This xquery
lists some frequency calculation of words, ordered.
What I want to do is limit the results by 10. I tried to use positional values but as it gives me the position of the word in the word list, it didnt work out..
Any help?