public static List<DecompoundedWord> filterAndSort(List<DecompoundedWord> aSplits){
  List<DecompoundedWord> filtered=new ArrayList<DecompoundedWord>();
  for (  DecompoundedWord s : aSplits) {
    if (!Double.isInfinite(s.getWeight()) && !Double.isInfinite(s.getWeight()) && (s.getWeight() > 0.0)) {
      filtered.add(s);
    }
  }
  Collections.sort(filtered);
  if (filtered.isEmpty()) {
    filtered.add(aSplits.get(0));
  }
  return filtered;
}

public static List < DecompoundedWord > filterAndSort ( List < DecompoundedWord > aSplits ) { List < DecompoundedWord > filtered = new ArrayList < DecompoundedWord > ( ) ; for ( DecompoundedWord s : aSplits ) { if ( ! Double . isInfinite ( s . getWeight ( ) ) && ! Double . isInfinite ( s . getWeight ( ) ) && ( s . getWeight ( ) > 0.0 ) ) { filtered . add ( s ) ; } } Collections . sort ( filtered ) ; if ( filtered . isEmpty ( ) ) { filtered . add ( aSplits . get ( 0 ) ) ; } return filtered ; }
expects that the splits list contains at least one element and that this is the unsplit word .
