else {    } if (debugAddToChart) { if (added) System.err.println(className + ": added item(" + start + "," + end + "): " + item); }  return added;
  public void add(int start, int end, Item item) {    Map map = chart[start][end];    Object label = item.label();    SortedMap items = (SortedMap)map.get(label);    if (items == null) {      items = new TreeMap();      map.put(label, items);      items.put(item, new Double(item.logProb()));    }    else if (!toPrune(items, item)) {      // see if equal (technically, equivalent) item already exists      // but has a lower probability, replace it with current item      Double itemProb = (Double)items.get(item);      if (itemProb == null ||          (itemProb != null && itemProb.doubleValue() < item.logProb()))	items.put(item, new Double(item.logProb()));      prune(items);    }  }