@Override
    public HashMap<String, Float> getWeightsForQuery(HashMap<String, Integer> query) {
        try {
            HashMap<String, Float> weights = new HashMap<String, Float>();
            float total = 0.0f;
            for (int n : query.values()){
                total += n;
            }
            if (total == 0)
                total = 1.0f;
            for (String stem : query.keySet()) {
                float wtq;
                switch (MODEL){
                    case 1:
                        wtq = 1.0f;
                        break;
                    case 2:
                        wtq = query.get(stem) / total;
                        break;
                    case 3:
                    case 4:
                        wtq = index.getIdfsForStem(stem);
                        break;
                    case 5:
                        wtq = (float)Math.log10(query.get(stem)/total) * index.getIdfsForStem(stem);
                        break;
                    default:
                        wtq = 1.0f;

                }
                weights.put(stem, wtq);
            }
            return  weights;

        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }