private HashMap<String, Double> extractFeaturesWithScores(
            HashMap<String, HashMap<String, Double>> foList) {
        HashMap<String, Double> finalFeatures = new HashMap<String, Double>();
        for (Map.Entry<String, HashMap<String, Double>> entry : foList
                .entrySet()) {
            String[] featureArray = entry.getKey().split(" ");
            TreeMap<Integer, String> featureList = new TreeMap<Integer, String>();
            for (String f : featureArray) {
                String[] arr = f.split("-");
                int index = Integer.parseInt(arr[1]);
                featureList.put(index, arr[0]);
            }
            for (Map.Entry<String, Double> scoreEntry : entry.getValue()
                    .entrySet()) {
                String[] opinionArr = scoreEntry.getKey().split("-");
                int opinionIndex = Integer.parseInt(opinionArr[1]);
                featureList.put(opinionIndex, opinionArr[0]);
                String finalFeature = "";
                for (Map.Entry<Integer, String> orderedEntry : featureList
                        .entrySet()) {
                    finalFeature += orderedEntry.getValue() + " ";
                }
                finalFeatures.put(finalFeature.trim(), scoreEntry.getValue());
                featureList.remove(opinionIndex);
            }
        }
        return finalFeatures;
    }