private void addTermFrequencies ( Map < String , Int > termFreqMap , TermFreqVector vector ) { String [ ] terms = vector . getTerms ( ) ; int [ ] freqs = vector . getTermFrequencies ( ) ; for ( int j = 0 ; j < terms . length ; j ++ ) { String term = terms [ j ] ; if ( isNoiseWord ( term ) ) { continue ; } // increment frequency Int cnt = termFreqMap . get ( term ) ; if ( cnt == null ) { cnt = new Int ( ) ; termFreqMap . put ( term , cnt ) ; cnt . x = freqs [ j ] ; } else { cnt . x += freqs [ j ] ; } } }
Adds terms and frequencies found in vector into the Map termFreqMap