code: public SparseDoubleVector generateContext(DependencyTreeNode[] tree,
                                                int focusIndex) {
          DependencyTreeNode focusNode = tree[focusIndex];
  
          SparseDoubleVector focusMeaning = new CompactSparseVector();
          // Get all the valid paths starting from this word. 
          Iterator<DependencyPath> paths = new FilteredDependencyIterator(
                  focusNode, 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 with the weight generated by the
          // DependencyPathWeight function.
          while (paths.hasNext()) {
              DependencyPath path = paths.next();
  
              // Get the dimension from the basis mapping, ignore any features
              // that are not mapped.
              int dimension = basisMapping.getDimension(path);
                  if (dimension < 0)
                      continue;
  
              double weight = weighter.scorePath(path);
              focusMeaning.add(dimension, weight);                                        
          }
          return focusMeaning;
      }
docs: {@inheritDoc}