void updateFeatureCounts(int[] translationIds,List<List<RichTranslation<IString,String>>> nbestLists){
  for (int i=0; i < translationIds.length; i++) {
    Set<String> features=new HashSet<String>();
    for (    RichTranslation<IString,String> trans : nbestLists.get(i)) {
      for (      FeatureValue<String> f : trans.features) {
        features.add(f.name);
      }
    }
synchronized (clippedFeatureIndex) {
      for (      String fName : features) {
        Set<Integer> ids=clippedFeatureIndex.get(fName);
        if (ids == null) {
          ids=new TreeSet<Integer>();
          clippedFeatureIndex.put(fName,ids);
        }
        if (ids.size() < minFeatureCount) {
          ids.add(translationIds[i]);
        }
      }
    }
  }
}

void updateFeatureCounts ( int [ ] translationIds , List < List < RichTranslation < IString , String > > > nbestLists ) { for ( int i = 0 ; i < translationIds . length ; i ++ ) { Set < String > features = new HashSet < String > ( ) ; for ( RichTranslation < IString , String > trans : nbestLists . get ( i ) ) { for ( FeatureValue < String > f : trans . features ) { features . add ( f . name ) ; } } synchronized ( clippedFeatureIndex ) { for ( String fName : features ) { Set < Integer > ids = clippedFeatureIndex . get ( fName ) ; if ( ids == null ) { ids = new TreeSet < Integer > ( ) ; clippedFeatureIndex . put ( fName , ids ) ; } if ( ids . size ( ) < minFeatureCount ) { ids . add ( translationIds [ i ] ) ; } } } } }
update counts of the number of times we have seen each feature . features are only counted ounce per source sentence
