edu.northwestern.at.wordhoard.swing.calculator.modelutils
Class CollocateUtils

java.lang.Object
  extended by edu.northwestern.at.wordhoard.swing.calculator.modelutils.CollocateUtils

public class CollocateUtils
extends java.lang.Object

Collocate utilities.


Constructor Summary
protected CollocateUtils()
          Don't allow instantiation but do allow overrides.
 
Method Summary
static java.util.Collection getColocates(PersistenceManager pm, java.util.Collection words, int distance)
          Gets colocates for a collection of words.
static java.util.Collection getColocates(PersistenceManager pm, java.util.Collection words, int leftSpan, int rightSpan)
          Gets colocates for a collection of words.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollocateUtils

protected CollocateUtils()
Don't allow instantiation but do allow overrides.

Method Detail

getColocates

public static java.util.Collection getColocates(PersistenceManager pm,
                                                java.util.Collection words,
                                                int distance)
Gets colocates for a collection of words.

Parameters:
pm - The persistence manager in which to load the collocates. May be null.
words - Collection of word occurrences.
distance - Max distance.
Returns:
A collection of all the word occurrences which are within "distance" words of one of the specified words. May be empty. Null if the collocates could not be found because of a databae problem.
Throws:
PersistenceException

getColocates

public static java.util.Collection getColocates(PersistenceManager pm,
                                                java.util.Collection words,
                                                int leftSpan,
                                                int rightSpan)
Gets colocates for a collection of words.

Parameters:
pm - The persistence manager in which to load the collocates. May be null.
words - Collection of word occurrences.
leftSpan - Max distance to the left.
rightSpan - Max distance to the right.
Returns:
A collection of all the word occurrences which are within "leftSpan" to "rightSpan" distance of one of the specified words.