SexpList mapSet = (SexpList)posMap.get(word.word()); if (mapSet == null) posMap.put(word.word(), (mapSet = new SexpList(2)).add(word.tag())); else if (!mapSet.contains(word.tag())) mapSet.add(word.tag());
addToPosMap(word.word(), word.tag()); if (keepAllWords && word.features() != null) addToPosMap(word.features(), word.tag());
  protected final void addToPosMap(Map posMap, Word word) {    if (isRealWord(word)) {      SexpList mapSet = (SexpList)posMap.get(word.word());      if (mapSet == null)	posMap.put(word.word(), (mapSet = new SexpList(2)).add(word.tag()));      else if (!mapSet.contains(word.tag()))	mapSet.add(word.tag());    }  }