@Override
    public HashMap<String, Float> getDocWeightsForDoc(long idDoc) {
        try {
            HashMap<String, Integer> doc = index.getTfsForDoc(idDoc);
            int total = 0;
            for (int v : doc.values()) {
                total += v;
            }
            HashMap<String, Float> weights = new HashMap<String, Float>();
            for (String key : doc.keySet()) {
                float wtd;
                switch (MODEL){
                    case 1:
                    case 2:
                    case 3:
                        wtd =  (float)(doc.get(key)) / total;
                        break;
                    case 4:
                        wtd = (float)Math.log10((float)(doc.get(key)) / total);
                        break;
                    case 5:
                        wtd = (float)Math.log10((float)(doc.get(key)) / total) * index.getIdfsForStem(key);
                        break;
                    default:
                        wtd = (float)(doc.get(key)) / total;
                        break;
                }
                weights.put(key,wtd);
            }
            return weights;

        } catch (IOException e) {
            e.printStackTrace();
            System.out.println("Doc ID not found!");
            return null;
        }
    }