if (logProb <= logOfZero) continue;
if (logProb <= logOfZero) { if (hardConstraints) continue; else logProb = Constants.logProbSmall; }
  protected List addUnaries(CKYItem item, List itemsAdded)  throws RemoteException {    // get possible parent nonterminals    Symbol[] nts;    if (useHeadToParentMap) {      nts = (Symbol[])headToParentMap.get(item.label());      // this item's root label was ONLY seen as a modifier      if (nts == null)	return itemsAdded;    }    else      nts = nonterminals;    unaryItemsToAdd.clear();    CKYItem newItem = chart.getNewItem();    // set some values now, most to be filled in by code below    newItem.set(null, item.headWord(), null, null, item,		null, null, startList, startList,		item.start(), item.end(),		false, false, false, 0.0, 0.0, 0.0);    newItem.hasAntecedent(item);    Symbol headSym = (Symbol)item.label();    HeadEvent headEvent = lookupHeadEvent;    headEvent.set(item.headWord(), null, headSym, emptySubcat, emptySubcat);    PriorEvent priorEvent = lookupPriorEvent;    priorEvent.set(item.headWord(), null);    int numNTs = nts.length;    // foreach possible parent nonterminal    for (int ntIndex = 0; ntIndex < numNTs; ntIndex++) {      Symbol parent = nts[ntIndex];      headEvent.setParent(parent);      Subcat[] leftSubcats = getPossibleSubcats(leftSubcatMap, headEvent,						leftSubcatPS,						leftSubcatPSLastLevel);      Subcat[] rightSubcats = getPossibleSubcats(rightSubcatMap, headEvent,						 rightSubcatPS,						 rightSubcatPSLastLevel);      if (debugUnaries) {	if (item.start() == 13 && item.end() == 20 &&	    headSym == VP && parent == SA) {	  System.err.println(className + ".addUnaries: trying to build on " +			     headSym + " with " + parent);	}      }      int numLeftSubcats = leftSubcats.length;      int numRightSubcats = rightSubcats.length;      if (numLeftSubcats > 0 && numRightSubcats > 0) {	// foreach possible right subcat	for (int rightIdx = 0; rightIdx < numRightSubcats; rightIdx++) {	  Subcat rightSubcat = (Subcat)rightSubcats[rightIdx];	  // foreach possible left subcat	  for (int leftIdx = 0; leftIdx < numLeftSubcats; leftIdx++) {	    Subcat leftSubcat = (Subcat)leftSubcats[leftIdx];	    newItem.setLabel(parent);	    newItem.setLeftSubcat(leftSubcat);	    newItem.setRightSubcat(rightSubcat);	    headEvent.setLeftSubcat(leftSubcat);	    headEvent.setRightSubcat(rightSubcat);	    if (debugUnaries) {	      if (item.start() == 13 && item.end() == 20 &&		  headSym == VP && parent == SA) {		System.err.println(className + ".addUnaries: trying to " +				   "build on " + headSym + " with " + parent +				   " and left subcat " + leftSubcat +				   " and right subcat " + rightSubcat);	      }	    }	    if (isomorphicTreeConstraints) {	      // get head child's constraint's parent and check that it is	      // locally satisfied by newItem	      if (item.getConstraint() == null) {		System.err.println("uh-oh: no constraint for item " + item);	      }	      Constraint headChildParent = item.getConstraint().getParent();	      if (headChildParent != null &&		  headChildParent.isLocallySatisfiedBy(newItem)) {		if (debugConstraints)		  System.err.println("assigning locally-satisfied constraint " +				     headChildParent + " to " + newItem);		newItem.setConstraint(headChildParent);	      }	      else {		if (debugConstraints)		  System.err.println("constraint " + headChildParent +				     " is not locally satisfied by item " +				     newItem);		continue;	      }	    }	    else if (findAtLeastOneSatisfyingConstraint) {	      Constraint constraint = constraints.constraintSatisfying(newItem);	      if (constraint == null)		continue;	      else		newItem.setConstraint(constraint);	    }	    double logProbLeftSubcat =	      (numLeftSubcats == 1 ? logProbCertain :	       server.logProbLeftSubcat(id, headEvent));	    double logProbRightSubcat =	      (numRightSubcats == 1 ? logProbCertain :	       server.logProbRightSubcat(id, headEvent));	    double logProbHead = server.logProbHead(id, headEvent);	    if (logProbHead <= logOfZero)	      continue;	    double logTreeProb =	      item.logTreeProb() +	      logProbHead + logProbLeftSubcat + logProbRightSubcat;	    priorEvent.setLabel(parent);	    double logPrior = server.logPrior(id, priorEvent);	    if (logPrior <= logOfZero)	      continue;	    double logProb = logTreeProb + logPrior;	    if (debugUnaries) {	      if (item.start() == 13 && item.end() == 20 &&		  headSym == VP && parent == SA &&		  leftSubcat.size() == 0 && rightSubcat.size() == 0) {		String msg =		  className + ".addUnaries: logprobs: lc=" +		  logProbLeftSubcat + "; rc=" +		  logProbRightSubcat + "; head=" + logProbHead +		  "; tree=" + logTreeProb + "; prior=" + logPrior;		System.err.println(msg);	      }	    }	    if (logProb <= logOfZero)	      continue;	    newItem.setLogTreeProb(logTreeProb);	    newItem.setLogPrior(logPrior);	    newItem.setLogProb(logProb);	    CKYItem newItemCopy = chart.getNewItem();	    newItemCopy.setDataFrom(newItem);	    unaryItemsToAdd.add(newItemCopy);	  }	} // end foreach possible left subcat      }    }    if (unaryItemsToAdd.size() > 0) {      Iterator toAdd = unaryItemsToAdd.iterator();      while (toAdd.hasNext()) {	CKYItem itemToAdd = (CKYItem)toAdd.next();	boolean added = chart.add(itemToAdd.start(), itemToAdd.end(), itemToAdd);	if (added)	  itemsAdded.add(itemToAdd);	else	  chart.reclaimItem(itemToAdd);      }    }    chart.reclaimItem(newItem);    return itemsAdded;  }