public static void calculateTFIDF() {

        System.out.println("calculateTFIDF running");
        Iterator iterator = dictionaryMap.entrySet().iterator();
        while (iterator.hasNext()) {
            Map.Entry termEntry = (Map.Entry) iterator.next();
            String token = (String) termEntry.getKey();
            ArrayList<String[]> postingsList = (ArrayList) termEntry.getValue();

            Double[] idFArray = (Double[]) inverseDocFreqMap.get(token);
            double inverseDocFreq = idFArray[IDF];

            for (int i = 0; i < postingsList.size(); i++) {

                String[] posting = postingsList.get(i);
                double termFrequency = Double.parseDouble(posting[TERM_FREQ]);
                double newTFIDF = inverseDocFreq * termFrequency;
                posting[TFIDF_WEIGHT] = String.valueOf(newTFIDF);
                postingsList.set(i, posting);
            }
            dictionaryMap.put(token, postingsList);
        }
    }