csli.util.nlp
Class StopWords

java.lang.Object
  extended by csli.util.nlp.StopWords

public class StopWords
extends Object

An English stop word list with methods to check membership, remove members from other collections etc.

Author:
mpurver

Constructor Summary
StopWords()
           
 
Method Summary
static boolean contains(String word)
          Check if a String word is a stop word
static String[] getArray()
          Get the current stop-word list as an array
static Collection<String> getSet()
          Get the current stop-word list as a Collection
static void remove(Collection<String> data)
          Remove stop words from a Collection of String words
static String remove(String in)
          Remove stop words from a whitespace-separated String of words
static String[] remove(String[] in)
          Remove stop words from an array of String words
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopWords

public StopWords()
Method Detail

remove

public static void remove(Collection<String> data)
Remove stop words from a Collection of String words

Parameters:
data -

remove

public static String[] remove(String[] in)
Remove stop words from an array of String words

Parameters:
data -
Returns:
a new array without the stop words

remove

public static String remove(String in)
Remove stop words from a whitespace-separated String of words

Parameters:
data -
Returns:
a new String without the stop words

contains

public static boolean contains(String word)
Check if a String word is a stop word

Parameters:
word -
Returns:
true if word is in the current stop-word set, false if not

getArray

public static String[] getArray()
Get the current stop-word list as an array

Returns:
an array of String stop-words

getSet

public static Collection<String> getSet()
Get the current stop-word list as a Collection

Returns:
a Collection (HashSet) of String stop-words