System.err.println("parent: " + parent +
System.err.println(className + ": parent: " + parent +
  protected List addUnaries(CKYItem item, List itemsAdded)  throws RemoteException {    unaryItemsToAdd.clear();    CKYItem newItem = chart.getNewItem();    newItem.set(null, item.headWord(), null, null, item,                null, null, startList, startList,                item.start(), item.end(),                false, false, false, 0.0, 0.0);    Symbol headSym = (Symbol)item.label();    HeadEvent headEvent = lookupHeadEvent;    headEvent.set(item.headWord(), null, headSym, emptySubcat, emptySubcat);    HeadEvent priorEvent = lookupPriorEvent;    priorEvent.set(item.headWord(), stopSym, headSym, emptySubcat, emptySubcat);    // foreach nonterminal    for (int ntIndex = 0; ntIndex < nonterminals.length; ntIndex++) {      Symbol parent = nonterminals[ntIndex];      headEvent.setParent(parent);      Set leftSubcats = getPossibleSubcats(leftSubcatMap, headEvent,                                           leftSubcatPS,                                           leftSubcatPSLastLevel);      Set rightSubcats = getPossibleSubcats(rightSubcatMap, headEvent,                                            rightSubcatPS,                                            rightSubcatPSLastLevel);      if (debugUnaries) {        if (newItem.start() == 3 && newItem.end() == 7 &&            parent == S && headSym == VP) {          System.err.println("parent=" + parent + "; head=" + headSym +                             "; headWord=" + item.headWord());        }      }      Iterator leftSubcatIt = leftSubcats.iterator();      // foreach possible left subcat      while (leftSubcatIt.hasNext()) {        Subcat leftSubcat = (Subcat)leftSubcatIt.next();        Iterator rightSubcatIt = rightSubcats.iterator();        // foreach possible right subcat        while (rightSubcatIt.hasNext()) {          Subcat rightSubcat = (Subcat)rightSubcatIt.next();          newItem.setLabel(parent);          newItem.setLeftSubcat(leftSubcat);          newItem.setRightSubcat(rightSubcat);          headEvent.setLeftSubcat(leftSubcat);          headEvent.setRightSubcat(rightSubcat);          if (debugUnaries) {            if (newItem.start() == 3 && newItem.end() == 7 &&                parent == S && headSym == VP &&                newItem.headWord().word() == willSym &&                newItem.headWord().tag() == mdSym) {              System.err.println("parent: " + parent +                                 "; lc=" + leftSubcat.toSexp() +                                 "; rc=" + rightSubcat.toSexp());              Debug.level = 20;            }          }          double logTreeProb =            item.logTreeProb() + server.logProbHead(id, headEvent);          double logPrior = server.logPrior(id, priorEvent);          double logProb = logTreeProb + logPrior;          if (debugUnaries) {            if (newItem.start() == 3 && newItem.end() == 7 &&                parent == S && headSym == VP &&                newItem.headWord().word() == willSym &&                newItem.headWord().tag() == mdSym) {              System.err.println("trying to add " + newItem +                                 " with logTreeProb=" + logTreeProb +                                 "; logPrior=" + logPrior +                                 "; logProb=" + logProb);              Debug.level = 0;            }          }          if (logProb <= Constants.logOfZero)            continue;          newItem.setLogTreeProb(logTreeProb);          newItem.setLogProb(logProb);          CKYItem newItemCopy = chart.getNewItem();          newItemCopy.setDataFrom(newItem);          unaryItemsToAdd.add(newItemCopy);        }      }    }    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;  }