edu.mit.jmwe.detect
Class StopWords

java.lang.Object
  extended by edu.mit.jmwe.detect.StopWords
All Implemented Interfaces:
IMWEDetector

public class StopWords
extends Object
implements IMWEDetector

Uses the exhaustive strategy specified in Exhaustive to find the MWEs that consist entirely of stop words in a sentence.

Since:
jMWE 1.0.0
Version:
$Id: StopWords.java 620 2011-05-08 21:13:58Z markaf $
Author:
N. Kulkarni, M.A. Finlayson

Field Summary
static List<String> defaultIndex
          A list of MWEs whose parts consist entirely of stop words.
 
Constructor Summary
StopWords()
          Constructs this detector from the default stop word MWE index.
StopWords(IMWEIndex index)
          Constructs this detector from the given stop word MWE index.
 
Method Summary
<T extends IToken>
List<IMWE<T>>
detect(List<T> sentence)
          Given a list of tokens, the detector searches for the MWEs in the list.
protected static IMWEIndex getStopWordIndex()
          Creates, opens, and returns a new stop word index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultIndex

public static List<String> defaultIndex
A list of MWEs whose parts consist entirely of stop words.

Since:
jMWE 1.0.0
Constructor Detail

StopWords

public StopWords()
Constructs this detector from the default stop word MWE index.

Throws:
IOException - if an IOException occurs when constructing the index.
Since:
jMWE 1.0.0

StopWords

public StopWords(IMWEIndex index)
Constructs this detector from the given stop word MWE index.

Parameters:
index - the index of stop words that backs this detector
Throws:
NullPointerException - if the index is null.
Since:
jMWE 1.0.0
Method Detail

detect

public <T extends IToken> List<IMWE<T>> detect(List<T> sentence)
Description copied from interface: IMWEDetector
Given a list of tokens, the detector searches for the MWEs in the list. It returns a set of IMWE objects representing these multi-word expressions. The method returns an empty list if no MWEs are found; the method should never return null.

Specified by:
detect in interface IMWEDetector
Type Parameters:
T - the type of the tokens in the sentence
Parameters:
sentence - a sentence which the detector should search for multi-word expressions.
Returns:
a list of IMWE objects representing the multi-word expressions found in the sentence. Returns an empty list if no multi-word expressions are found; never returns null

getStopWordIndex

protected static IMWEIndex getStopWordIndex()
Creates, opens, and returns a new stop word index.

Returns:
a new, open stop word index.
Since:
jMWE 1.0.0


Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.