From: Thomas M. <tsm...@us...> - 2002-11-20 02:41:33
|
Update of /cvsroot/maxent/maxent/src/java/opennlp/maxent In directory sc8-pr-cvs1:/tmp/cvs-serv30038/maxent Modified Files: DataIndexer.java Log Message: Fixed bug where singleton events are dropped. Index: DataIndexer.java =================================================================== RCS file: /cvsroot/maxent/maxent/src/java/opennlp/maxent/DataIndexer.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DataIndexer.java 19 Apr 2002 09:59:53 -0000 1.9 --- DataIndexer.java 20 Nov 2002 02:41:30 -0000 1.10 *************** *** 66,70 **** System.out.print("\tComputing event counts... "); events = computeEventCounts(eventStream,predicateIndex,cutoff); ! System.out.println("done."); System.out.print("\tIndexing... "); --- 66,70 ---- System.out.print("\tComputing event counts... "); events = computeEventCounts(eventStream,predicateIndex,cutoff); ! System.out.println("done. "+events.size()+" events"); System.out.print("\tIndexing... "); *************** *** 157,167 **** if (! predicatesInOut.containsKey(ec[j])) { if (counter.increment(ec[j])) { - if (counter.get(ec[j]) >= cutoff) { - predicatesInOut.put(ec[j], predicateIndex++); - counter.remove(ec[j]); - } } else { counter.put(ec[j], 1); } } } --- 157,167 ---- if (! predicatesInOut.containsKey(ec[j])) { if (counter.increment(ec[j])) { } else { counter.put(ec[j], 1); } + if (counter.get(ec[j]) >= cutoff) { + predicatesInOut.put(ec[j], predicateIndex++); + counter.remove(ec[j]); + } } } *************** *** 208,211 **** --- 208,214 ---- eventsToCompare.add(ce); } + else { + System.err.println("Dropped event "+ev.getOutcome()+":"+Arrays.asList(ev.getContext())); + } // recycle the TIntArrayList indexedContext.resetQuick(); |