reuturn only recommendations of words that have a greater count than the original word

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6307 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 604c37927f
commit d64569aa39

@ -95,10 +95,13 @@ public class DidYouMean {
long timelimit = 2 * System.currentTimeMillis() - startTime + timeout;
if (System.currentTimeMillis() > timelimit) return preSorted;
Set<String> countSorted = Collections.synchronizedSortedSet(new TreeSet<String>(new indexSizeComparator()));
int wc = index.count(Word.word2hash(word)); // all counts must be greater than this
int c0;
for (String s: preSorted) {
if (System.currentTimeMillis() > timelimit) break;
if (preSortSelection <= 0) break;
countSorted.add(s);
c0 = index.count(Word.word2hash(s));
if (c0 > wc) countSorted.add(s);
preSortSelection--;
}
return countSorted;

Loading…
Cancel
Save