code: @SuppressWarnings("unchecked")
      private void updateSemantics(SemanticVector toUpdate,
                                   String cooccurringWord,
                                   TernaryVector iv) {
          SemanticVector prevWordSemantics = getSemanticVector(cooccurringWord);
          
          Integer occurrences = wordToOccurrences.get(cooccurringWord);
          if (occurrences == null)
              occurrences = 0;
          double semanticWeight = 
              1d / (Math.exp(occurrences / historyDecayRate));
                      
          // The meaning is updated as a combination of the index vector and the
          // semantics, which is weighted by how many times the co-occurring word
          // has been seen.  The semantics of frequently co-occurring words
          // receive less weight, i.e. the index vector is weighted more.
          add(toUpdate, iv, impactRate * (1 - semanticWeight));
          toUpdate.addVector(prevWordSemantics, impactRate * semanticWeight);
      }
docs: Update the semantics using the weighed combination of the semantics of
  the co-occurring word and the provided index vector.  Note that the index
  vector is provided so that the caller can permute it as necessary.
  
  @param toUpdate the semantics to be updated
  @param cooccurringWord the word that is co-occurring
  @param iv the index vector for the co-occurring word, which has be
  permuted as necessary