{
Map<String,Integer> bonusEcpm = new HashMap<String,Integer>();
Set<String> words = tokenize(content);
for (String word : words){
String wordBonus = zintersect(
trans, 30, new ZParams().weights(0, 1), matched, word);
bonusEcpm.put(wordBonus, 1);
}
if (bonusEcpm.size() > 0){
String[] keys = new String[bonusEcpm.size()];
int[] weights = new int[bonusEcpm.size()];
int index = 0;
for (Map.Entry<String,Integer> bonus : bonusEcpm.entrySet()){
keys[index] = bonus.getKey();
weights[index] = bonus.getValue();
index++;
}
ZParams minParams = new ZParams().aggregate(ZParams.Aggregate.MIN).weights(weights);
String minimum = zunion(trans, 30, minParams, keys);
ZParams maxParams = new ZParams().aggregate(ZParams.Aggregate.MAX).weights(weights);
String maximum = zunion(trans, 30, maxParams, keys);
String result = zunion(
trans, 30, new ZParams().weights(2, 1, 1), base, minimum, maximum);
return new Pair<Set<String>,String>(words, result);
}
return new Pair<Set<String>,String>(words, base);
}