|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsg.edu.nus.comp.nlp.ims.feature.CSurroundingWordExtractor
public class CSurroundingWordExtractor
surrounding word extractor.
Field Summary | |
---|---|
protected static int |
g_LIDX
|
protected static int |
g_TIDX
|
protected ICorpus |
m_Corpus
|
protected IFeature |
m_CurrentFeature
|
protected CSurroundingWordFilter |
m_Filter
|
protected int |
m_Index
|
protected int |
m_IndexInSentence
|
protected int |
m_InstanceLength
|
protected int |
m_Left
|
protected int |
m_Right
|
protected ISentence |
m_Sentence
|
protected int |
m_SurroundingWordIndex
|
protected java.util.ArrayList<java.lang.String> |
m_SurroundingWords
|
protected java.util.HashSet<java.lang.String> |
m_SurroundingWordSet
|
Constructor Summary | |
---|---|
CSurroundingWordExtractor()
constructor |
|
CSurroundingWordExtractor(java.util.HashSet<java.lang.String> p_StopWords)
constructor |
|
CSurroundingWordExtractor(int p_Left,
int p_Right)
constructor |
|
CSurroundingWordExtractor(int p_Left,
int p_Right,
java.util.HashSet<java.lang.String> p_StopWords)
constructor |
Method Summary | |
---|---|
boolean |
filter(java.lang.String p_Word)
check whether word is in stop word list or contains no alphabet |
java.lang.String |
getCurrentInstanceID()
get the ID of current instance to be extracted |
boolean |
hasNext()
whether has at least one more feature |
IFeature |
next()
get the next feature |
boolean |
restart()
restart the iterator |
boolean |
setCorpus(ICorpus p_Corpus)
set corpus to be extracted |
boolean |
setCurrentInstance(int p_Index)
set the index of instance which to be extracted from corpus |
protected boolean |
validIndex(int p_Index)
check the validity of index |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ICorpus m_Corpus
protected int m_Index
protected ISentence m_Sentence
protected int m_IndexInSentence
protected int m_InstanceLength
protected int m_SurroundingWordIndex
protected java.util.HashSet<java.lang.String> m_SurroundingWordSet
protected java.util.ArrayList<java.lang.String> m_SurroundingWords
protected int m_Left
protected int m_Right
protected CSurroundingWordFilter m_Filter
protected IFeature m_CurrentFeature
protected static int g_LIDX
protected static int g_TIDX
Constructor Detail |
---|
public CSurroundingWordExtractor()
public CSurroundingWordExtractor(int p_Left, int p_Right)
p_Left
- number of sentences left to current sentence that will be used to extract surrounding wordsp_Right
- number of sentences right to current sentence that will be used to extract surrounding wordspublic CSurroundingWordExtractor(java.util.HashSet<java.lang.String> p_StopWords)
p_StopWords
- stop word listpublic CSurroundingWordExtractor(int p_Left, int p_Right, java.util.HashSet<java.lang.String> p_StopWords)
p_Left
- number of sentences left to current sentence that will be used to extract surrounding wordsp_Right
- number of sentences right to current sentence that will be used to extract surrounding wordsp_StopWords
- stop word listMethod Detail |
---|
public java.lang.String getCurrentInstanceID()
IFeatureExtractor
getCurrentInstanceID
in interface IFeatureExtractor
public boolean hasNext()
IFeatureExtractor
hasNext
in interface IFeatureExtractor
public IFeature next()
IFeatureExtractor
next
in interface IFeatureExtractor
public boolean restart()
IFeatureExtractor
restart
in interface IFeatureExtractor
public boolean setCorpus(ICorpus p_Corpus)
IFeatureExtractor
setCorpus
in interface IFeatureExtractor
p_Corpus
- corpus to be extracted
protected boolean validIndex(int p_Index)
p_Index
- index
public boolean filter(java.lang.String p_Word)
p_Word
- word
public boolean setCurrentInstance(int p_Index)
IFeatureExtractor
setCurrentInstance
in interface IFeatureExtractor
p_Index
- instance index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |