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)) {
public boolean add(int start, int end, Item item) { totalItemsGenerated++; if (item.logProb() <= Constants.logOfZero) return false;  boolean added = false;  Map items = chart[start][end].map;  if (!toPrune(start, end, item)) {
  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);    }  }