chart.add(item.start(), item.end(), newItem, item, null, new TrainerEvent[]{leftModCopy, rightModCopy}, new double[]      {leftProb,    rightProb}); itemsAdded.add(newItem);
boolean added = chart.add(item.start(), item.end(), newItem, item, null, new TrainerEvent[]{leftModCopy, rightModCopy}, new double[]      {leftProb,    rightProb}); if (added) itemsAdded.add(newItem);
  protected List addStopProbs(EMItem item, List itemsAdded, int level)    throws RemoteException {    if (!(item.leftSubcat().empty() && item.rightSubcat().empty()))      return itemsAdded;    /*    SexpList leftPrevMods =      getPrevMods(item, item.leftPrevMods(), item.leftChildren());    SexpList rightPrevMods =      getPrevMods(item, item.rightPrevMods(), item.rightChildren());    */    // technically, we should invoke getPrevMods for both lists here, but there    // shouldn't be skipping of previous mods because of generation of stopSym    SexpList leftPrevMods = item.leftPrevMods();    SexpList rightPrevMods = item.rightPrevMods();    tmpChildrenList.set(null, item.leftChildren());    WordList leftPrevWords = getPrevModWords(item, tmpChildrenList, LEFT);    tmpChildrenList.set(null, item.rightChildren());    WordList rightPrevWords = getPrevModWords(item, tmpChildrenList, RIGHT);    ModifierEvent leftMod = lookupLeftStopEvent;    leftMod.set(stopWord, item.headWord(), stopSym, leftPrevMods,		leftPrevWords,		(Symbol)item.label(), item.headLabel(), item.leftSubcat(),		item.leftVerb(), Constants.LEFT);    ModifierEvent rightMod = lookupRightStopEvent;    rightMod.set(stopWord, item.headWord(), stopSym, rightPrevMods,		 rightPrevWords,		 (Symbol)item.label(), item.headLabel(),		 item.rightSubcat(), item.rightVerb(), Constants.RIGHT);    if (debugStops) {      //if (item.start() == 3 && item.end() == 4) {      if (true) {	System.err.println(className +			   ".addStopProbs: trying to add stops to item " +			   item);      }    }    if (isomorphicTreeConstraints) {      if (!item.getConstraint().isSatisfiedBy(item)) {	if (debugConstraints)	  System.err.println("constraint " + item.getConstraint() +			     " is not satisfied by item " + item);	return itemsAdded;      }    }    double leftProb = server.probMod(id, leftMod);    if (leftProb == probImpossible)      return itemsAdded;    double rightProb = server.probMod(id, rightMod);    if (rightProb == probImpossible)      return itemsAdded;    double insideProb =      item.insideProb() * leftProb * rightProb;    if (debugStops) {      //if (item.start() == 3 && item.end() == 4) {      if (true) {	System.err.println(className + ".addStopProbs: adding stops to item " +			   item);        System.err.println("\tnew inside prob: " + insideProb);      }    }    if (insideProb == probImpossible)      return itemsAdded;    EMItem newItem = chart.getNewEMItem();    newItem.set((Symbol)item.label(), item.headWord(),		item.leftSubcat(), item.rightSubcat(),		item.headChild(),		item.leftChildren(), item.rightChildren(),		item.leftPrevMods(), item.rightPrevMods(),		item.start(), item.end(), item.leftVerb(),		item.rightVerb(), true, level, insideProb);    if (isomorphicTreeConstraints) {      if (debugConstraints)	System.err.println("assigning satisfied constraint " +			   item.getConstraint() + " to " + newItem);      newItem.setConstraint(item.getConstraint());    }    // we can get away with using only a shallow copy, except we need to    // make an explicit (shallow) copy of the WordList object, since the    // one returned by getPrevModWords is one of only two possible "lookup"    // objects, prevModWordLeftLookupList or prevModWordRightLookupList    ModifierEvent leftModCopy = (ModifierEvent)leftMod.shallowCopy();    leftModCopy.setPreviousWords(leftMod.previousWords().copy());    ModifierEvent rightModCopy = (ModifierEvent)rightMod.shallowCopy();    rightModCopy.setPreviousWords(rightMod.previousWords().copy());    chart.add(item.start(), item.end(), newItem,	      item, null,	      new TrainerEvent[]{leftModCopy, rightModCopy},	      new double[]      {leftProb,    rightProb});    itemsAdded.add(newItem);    return itemsAdded;  }