code: protected void addContextTerms(SparseDoubleVector meaning,
                                     Queue<String> words,
                                     int distance) {
          // Iterate through the words in the context.
          for (String term : words) {
              if (!term.equals(IteratorFactory.EMPTY_TOKEN)) {
  
                  // If in read only mode, ignore any terms that are not already in the
                  // index map.
                  if (readOnly && !indexMap.containsKey(term))
                      continue;
  
                  // Get the index vector for the word.
                  TernaryVector termVector = indexMap.get(term);
                  if (termVector == null)
                      continue;
                  
                  // Permute the index vector if a permutation function is provided.
                  if (permFunc != null)
                          termVector = permFunc.permute(termVector, distance);
  
                  // Add the index vector and update the distance.
                  add(meaning, termVector);
                  ++distance;
              }
          }
      }
docs: Adds the index vector for each co-occurring word in the context.    Index
  vectors are permuted if {@code permFunc} is not {@code null}.    When in read
  only mode, only existing index vector are used.