private FeatureValueComputer getFeatComputer(SupportedFeature currentFeature) {
return featuresComputers.get(currentFeature);
}
private LinkedHashMap<Integer, Double> computeSampleFeatures(DataUnit sample, ArrayList<Integer> theIndecies) {
FeatureValueComputer currentFeatComputer;
ArrayList<Feature> currentFeats;
LinkedHashMap<Integer, Double> sampleFeats = new LinkedHashMap<Integer, Double>();
int appendStartIndex = 0;
CorpusHolder tempCorpus = theIndecies == null ? theCorpus : theCorpus.getNeededCorpus(theIndecies);
for (int i = 0; i < neededFeats.size(); i++) {
currentFeatComputer = getFeatComputer(neededFeats.get(i));
currentFeats = allFeatures.get(i);
appendMap(sampleFeats, currentFeatComputer.computeFeatures(sample, currentFeats, tempCorpus), appendStartIndex);
appendStartIndex += currentFeats.size();
}
return sampleFeats;
}