code: public DoubleVector buildVector(BufferedReader document,
                                DoubleVector documentVector) {
          // Tokenize and determine what words exist in the document, along with
          // the requested meta information, such as a term frequency.
          Map<String, Integer> termCounts = new HashMap<String, Integer>();
          Iterator<String> articleTokens = IteratorFactory.tokenize(document);
          while (articleTokens.hasNext()) {
              String term = articleTokens.next();
              Integer count = termCounts.get(term);
              termCounts.put(term, (count == null || !useTermFreq)
                                   ? 1 : count.intValue() + 1);
          }
  
          // Iterate through each term in the document and sum the term Vectors 
          // found in the provided SemanticSpace.
          // If the underlying BasisMapping of the sspace is not read-only, then
          // the getVector method would try to access a non-existing element. 
          // We therefore check here if the word is in the mapping and
          // skip the word if it is not.
          Set<String> knownWords = sspace.getWords();
          for (Map.Entry<String, Integer> entry : termCounts.entrySet()) {
              if(knownWords.contains(entry.getKey())) {
                Vector termVector = sspace.getVector(entry.getKey());
                if (termVector == null)
                    continue;
                add(documentVector, termVector, entry.getValue());
              }
          }
  
          return documentVector;
      }
docs: Represent a document as the summation of term Vectors.
  
  @param document A {@code BufferedReader} for a document to project into a
  {@code SemanticSpace}.
  @param documentVector A {@code Vector} which has been pre-allocated to
  store the document's representation.  This is
  pre-allocated so that users of {@code
  DocumentVectorBuilder} can decide what type of
  {@code Vector} should be used to represent a
  document.
  
  @return {@code documentVector} after it has been modified to represent
  the terms in {@code document}.