if (word.equals(IteratorFactory.EMPTY_TOKEN)) {
++permutations;
continue;
}
TernaryVector iv = wordToIndexVector.get(word);
if (usePermutations) {
iv = permutationFunc.permute(iv, permutations);
++permutations;
}
updateSemantics(focusMeaning, word, iv);
}
// Repeat for the words in the forward window.
permutations = 1;
for (String word : nextWords) {
// Skip the addition of any words that are excluded from the
// filter set. Note that by doing the exclusion here, we
// ensure that the token stream maintains its existing
// ordering, which is necessary when permutations are taken
// into account.
if (word.equals(IteratorFactory.EMPTY_TOKEN)) {
++permutations;
continue;
}
TernaryVector iv = wordToIndexVector.get(word);
if (usePermutations) {
iv = permutationFunc.permute(iv, permutations);
++permutations;
}