if (keepLowFreqTags) addToPosMap(posMap, headWord);
if (keepLowFreqTags && !keepAllWords) addToPosMap(headWord.word(), headWord.tag());
  protected void alterLowFrequencyWords(HeadTreeNode tree) {    if (tree.isPreterminal()) {      if (tree.headWord().tag() != traceTag) {	Word headWord = tree.headWord();	if (vocabCounter.count(headWord.word()) < unknownWordThreshold) {	  if (keepLowFreqTags)	    addToPosMap(posMap, headWord);	  boolean isFirstWord = tree.leftIdx() == 0;	  Symbol oldWord = tree.originalHeadWord();	  if (oldWord == null)	    oldWord = headWord.word();	  Symbol features = wordFeatures.features(oldWord, isFirstWord);	  // if we want to keep all words, we simply *add* to this	  // Word's information by setting its features field; otherwise,	  // we simply *replace* the word itself with its feature vector	  if (keepAllWords)	    headWord.setFeatures(features);	  else	    headWord.setWord(features);	  wordFeatureCounter.add(features);	}      }    }    else {      alterLowFrequencyWords(tree.headChild());      for (Iterator mods = tree.preMods().iterator(); mods.hasNext(); )	alterLowFrequencyWords((HeadTreeNode)mods.next());      for (Iterator mods = tree.postMods().iterator(); mods.hasNext(); )	alterLowFrequencyWords((HeadTreeNode)mods.next());    }  }