|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsg.edu.nus.comp.nlp.ims.util.CSurroundingWordFilter
public class CSurroundingWordFilter
filter stop words and words that contains no alphabet.
Field Summary | |
---|---|
protected static java.util.regex.Pattern |
ALPHABET
|
protected static CSurroundingWordFilter |
DEFAULT
|
protected java.util.HashSet<java.lang.String> |
m_StopWords
|
Constructor Summary | |
---|---|
protected |
CSurroundingWordFilter()
constructor |
|
CSurroundingWordFilter(java.util.HashSet<java.lang.String> p_StopWords)
constructor |
|
CSurroundingWordFilter(java.io.InputStream p_StopwordStream)
constructor given stop word list |
|
CSurroundingWordFilter(java.lang.String p_StopwordFile)
constructor given stop word list |
Method Summary | |
---|---|
boolean |
filter(java.lang.String p_Word)
check whether word is in stop word list or contains no alphabet |
static CSurroundingWordFilter |
getInstance()
get an surrouding word filter with default stop word list |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static CSurroundingWordFilter DEFAULT
protected static java.util.regex.Pattern ALPHABET
protected java.util.HashSet<java.lang.String> m_StopWords
Constructor Detail |
---|
protected CSurroundingWordFilter()
public CSurroundingWordFilter(java.util.HashSet<java.lang.String> p_StopWords)
p_StopWords
- stop word listpublic CSurroundingWordFilter(java.io.InputStream p_StopwordStream) throws java.io.IOException
p_StopwordStream
- stop word inputstream
java.io.IOException
- exception while loading stop wordspublic CSurroundingWordFilter(java.lang.String p_StopwordFile) throws java.io.IOException
p_StopwordFile
- stop word file
java.io.IOException
- exception while loading stop wordsMethod Detail |
---|
public boolean filter(java.lang.String p_Word)
p_Word
- word
public static CSurroundingWordFilter getInstance()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |