// inverse document frequency quotient between the number of docs in corpus and number of docs the 
        // term appears Normalize the value in case the number of appearances is 0.
        double idf =Math.log10((double) numberOfDocumentsInCorpus / 
         (double)((numberOfDocumentsInCorpusWhereKeyAppears ==0?1:0)+ 
            numberOfDocumentsInCorpusWhereKeyAppears));