// Local state variables for updating the current word's vector.
String curWord = null;
IntegerVector semantics = null;
while (occurrences.hasNext()) {
WordCooccurrence occ = occurrences.next();
String word = occ.focusWord();
// Base case for the first word seen
if (curWord == null) {
curWord = word;
semantics = createSemanticVector();
}