code: 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];
           }
        }
     }
docs: Adds terms and frequencies found in vector into the Map termFreqMap
  @param termFreqMap a Map of terms and their frequencies
  @param vector List of terms and their frequencies for a doc/field