public DoubleVector buildVector(Collection<String> articleTokens,DoubleVector documentVector){
  Map<String,Integer> termCounts=new HashMap<String,Integer>();
  for (  String term : articleTokens) {
    Integer count=termCounts.get(term);
    termCounts.put(term,(count == null || !useTermFreq) ? 1 : count.intValue() + 1);
  }
  for (  Map.Entry<String,Integer> entry : termCounts.entrySet()) {
    Vector termVector=sspace.getVector(entry.getKey());
    if (termVector == null) {
      continue;
    }
    add(documentVector,termVector,entry.getValue());
  }
  return documentVector;
}

public DoubleVector buildVector ( Collection < String > articleTokens , DoubleVector documentVector ) { Map < String , Integer > termCounts = new HashMap < String , Integer > ( ) ; for ( String term : articleTokens ) { Integer count = termCounts . get ( term ) ; termCounts . put ( term , ( count == null || ! useTermFreq ) ? 1 : count . intValue ( ) + 1 ) ; } for ( Map . Entry < String , Integer > entry : termCounts . entrySet ( ) ) { Vector termVector = sspace . getVector ( entry . getKey ( ) ) ; if ( termVector == null ) { continue ; } add ( documentVector , termVector , entry . getValue ( ) ) ; } return documentVector ; }
represent a document as the summation of term vectors .
