code: public void processDocument(BufferedReader document) throws IOException {
          
          // Iterate over all of the parseable dependency parsed sentences in the
          // document.
          for (DependencyTreeNode[] nodes = null; 
                   (nodes = extractor.readNextTree(document)) != null; ) {
  
              // Skip empty documents.
              if (nodes.length == 0)
                  continue;            
  
              // Examine the paths for each word in the sentence.
              for (int wordIndex = 0; wordIndex < nodes.length; ++wordIndex) {
  
                  String focusWord = nodes[wordIndex].word();              
  
                  // Acquire the semantic vector for the focus word.
                  SparseDoubleVector focusMeaning = getSemanticVector(focusWord);
  
                  // Get all the valid paths starting from this word.  The
                  // acceptor will filter out any paths that don't contain the
                  // semantic connections we're looking for.
                  Iterator<DependencyPath> paths = new FilteredDependencyIterator(
                              nodes[wordIndex], acceptor, pathLength);
                  
                  // For each of the paths rooted at the focus word, update the
                  // co-occurrences of the focus word in the dimension that the
                  // BasisFunction states.
                  while (paths.hasNext()) {
                      DependencyPath path = paths.next();
  
                      // Get the dimension associated with the relation and/or
                      // words in the path from the basis function.  The basis
                      // function creates a specific dimension for the syntactic
                      // context in order to meaningfully comparable vectors.
                      int dimension = basisMapping.getDimension(path);
  
                      // Then calculate the weight for the feature presence in the
                      // dimension.  For example, the weighter might score paths
                      // inversely proportional to their length.
                      double weight = weighter.scorePath(path);
  
                      // Last, update the focus word's semantic vector based on
                      // the dimension and weight
                      synchronized(focusMeaning) {
                          focusMeaning.add(dimension, weight);                    
                      }
                  }
              }
          }
          document.close();
      }
docs: Extracts all the parsed sentences in the document and then updates the
  co-occurrence values for those paths matching the loaded set of
  templates, according to this instance's {@link BasisFunction}.  Path
  occurrences are weighted using this instance's {@link PathWeight}.