@Override
public Explanation explain(int doc){
String[] vals = _array.getTranslatedData(doc, _dataCache.valArray);
FloatList scoreList = new FloatArrayList(_dataCache.valArray.size());
ArrayList<Explanation> explList = new ArrayList<Explanation>(scoreList.size());
for (String val : vals)
{
int idx = _dataCache.valArray.indexOf(val);
if (idx>=0){
scoreList.add(_function.score(_dataCache.freqs[idx], _boostList[idx]));
explList.add(_function.explain(_dataCache.freqs[idx], _boostList[idx]));
}
}
Explanation topLevel = _function.explain(scoreList.toFloatArray());
for (Explanation sub : explList){
topLevel.addDetail(sub);
}
return topLevel;
}