lookupTriple.set(0, modEvent.parent()); lookupTriple.set(1, modEvent.head());
Symbol arglessParent = Language.training().removeArgAugmentation(modEvent.parent()); Symbol gaplessHead = (Symbol)Language.training().removeGapAugmentation(modEvent.head()); lookupTriple.set(0, arglessParent); lookupTriple.set(1, gaplessHead);
  private void deriveModNonterminalMap(ProbabilityStructure modMS,				       FlexibleMap canonicalMap) {    System.err.println("Deriving modifying nonterminal maps.");    int modMSLastLevel = modMS.numLevels() - 1;    SexpList lookupTriple = new SexpList(3).add(null).add(null).add(null);    SexpList lookupPair = new SexpList(2).add(null).add(null);    SexpList parentHeadSideTriple;    SexpList modPair;    // we want to ignore stop-word modifiers, as well as the "fake" modifier    // of +TOP+ that is the root of the observed tree; the nonStopAndNonTop    // filter accomplishes this    Filter filter = nonStopAndNonTop;    //Filter filter = allPass;    Iterator events = modifierEvents.keySet().iterator();    while (events.hasNext()) {      ModifierEvent modEvent = (ModifierEvent)events.next();      if (!filter.pass(modEvent))	continue;      Event context = modMS.getHistory(modEvent, modMSLastLevel).copy();      context.canonicalize(canonicalMap);      Event future = modMS.getFuture(modEvent, modMSLastLevel).copy();      future.canonicalize(canonicalMap);      addToValueSet(modNonterminalMap, context, future);      lookupTriple.set(0, modEvent.parent());      lookupTriple.set(1, modEvent.head());      lookupTriple.set(2, Constants.sideToSym(modEvent.side()));      parentHeadSideTriple = getCanonicalList(canonicalMap, lookupTriple);      lookupPair.set(0, modEvent.modifier());      lookupPair.set(1, modEvent.modHeadWord().tag());      modPair = getCanonicalList(canonicalMap, lookupPair);      addToValueSet(simpleModNonterminalMap, parentHeadSideTriple, modPair);    }    if (Settings.getBoolean(Settings.outputModNonterminalMap))      outputModNonterminalMap();  }