From: Jason B. <jas...@us...> - 2002-04-19 09:59:56
|
Update of /cvsroot/maxent/maxent/src/java/opennlp/maxent In directory usw-pr-cvs1:/tmp/cvs-serv25071/src/java/opennlp/maxent Modified Files: DataIndexer.java Log Message: Modified the cutoff loop to use the increment() method of TObjectIntHashMap. Index: DataIndexer.java =================================================================== RCS file: /cvsroot/maxent/maxent/src/java/opennlp/maxent/DataIndexer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DataIndexer.java 3 Jan 2002 16:43:23 -0000 1.8 --- DataIndexer.java 19 Apr 2002 09:59:53 -0000 1.9 *************** *** 156,165 **** for (int j=0; j<ec.length; j++) { if (! predicatesInOut.containsKey(ec[j])) { ! int count = counter.get(ec[j]) + 1; ! if (count >= cutoff) { ! predicatesInOut.put(ec[j], predicateIndex++); ! counter.remove(ec[j]); ! } else { ! counter.put(ec[j], count); } } --- 156,166 ---- for (int j=0; j<ec.length; j++) { 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); } } |