All pastes #185959 Raw Edit

Untitled

public java v1 · immutable
#185959 ·published 2006-09-29 13:00 UTC
rendered paste body
/**	 * Filters out pairs occuring more as once.	 * 	 * @return sorted list of pairs	 */	public static void shortestMatchFilter(ArrayList<ActiveTerm> activewords) {		// sort list. Now terms occuring more then once can easily be removed.		Collections.sort(activewords);		if (activewords.size() == 0)			return;		ArrayList<ActiveTerm> resultList = new ArrayList<ActiveTerm>();		ActiveTerm precedentPair = activewords.get(0);		resultList.add(activewords.get(0));		for (ActiveTerm term : activewords) {			if (term.getBeginIndex() != precedentPair.getBeginIndex()) {				resultList.add(term);				precedentPair = term;			}		}				activewords = resultList;      }