return ps;
}
private void getSimilarPhrasesAux(String phrase, int top, double[] curr, List<StringDoublePair> ps, Map<String,double[]> map)
{
StringDoublePair p;
double sim;
for (String key : map.keySet())
{
if (phrase.equals(key)) continue;
sim = UTMath.cosineSimilarity(curr, map.get(key));
if (ps.size() < top)
ps.add(new StringDoublePair(key, sim));
else
{
p = ps.get(top-1);
if (p.d < sim) p.set(key, sim);
}
Collections.sort(ps, Collections.reverseOrder());
}
}