sg.edu.nus.comp.nlp.ims.feature
Class CMixedFeatureExtractor

java.lang.Object
  extended by sg.edu.nus.comp.nlp.ims.feature.CMixedFeatureExtractor
All Implemented Interfaces:
IFeatureExtractor
Direct Known Subclasses:
CMixedAllWordsFeatureExtractor

public class CMixedFeatureExtractor
extends java.lang.Object
implements IFeatureExtractor

Mixed feature extractor.

Author:
zhongzhi

Field Summary
protected  ICorpus m_Corpus
           
protected  IFeature m_CurrentFeature
           
protected  java.util.ArrayList<IFeatureExtractor> m_FeatureExtractors
           
protected  int m_Index
           
protected  int m_InstanceIndex
           
 
Constructor Summary
CMixedFeatureExtractor()
          constructor
CMixedFeatureExtractor(java.util.ArrayList<IFeatureExtractor> p_FeatureExtractors)
          constructor
 
Method Summary
 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_InstanceIndex)
          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

m_FeatureExtractors

protected java.util.ArrayList<IFeatureExtractor> m_FeatureExtractors

m_Index

protected int m_Index

m_InstanceIndex

protected int m_InstanceIndex

m_Corpus

protected ICorpus m_Corpus

m_CurrentFeature

protected IFeature m_CurrentFeature
Constructor Detail

CMixedFeatureExtractor

public CMixedFeatureExtractor()
constructor


CMixedFeatureExtractor

public CMixedFeatureExtractor(java.util.ArrayList<IFeatureExtractor> p_FeatureExtractors)
constructor

Parameters:
p_FeatureExtractors - feature extractor list
Method Detail

validIndex

protected boolean validIndex(int p_Index)
check the validity of index

Parameters:
p_Index - index
Returns:
valid or not

getCurrentInstanceID

public java.lang.String getCurrentInstanceID()
Description copied from interface: IFeatureExtractor
get the ID of current instance to be extracted

Specified by:
getCurrentInstanceID in interface IFeatureExtractor
Returns:
instance id

hasNext

public boolean hasNext()
Description copied from interface: IFeatureExtractor
whether has at least one more feature

Specified by:
hasNext in interface IFeatureExtractor
Returns:
has or not

next

public IFeature next()
Description copied from interface: IFeatureExtractor
get the next feature

Specified by:
next in interface IFeatureExtractor
Returns:
feature

restart

public boolean restart()
Description copied from interface: IFeatureExtractor
restart the iterator

Specified by:
restart in interface IFeatureExtractor
Returns:
success or not

setCorpus

public boolean setCorpus(ICorpus p_Corpus)
Description copied from interface: IFeatureExtractor
set corpus to be extracted

Specified by:
setCorpus in interface IFeatureExtractor
Parameters:
p_Corpus - corpus to be extracted
Returns:
set success or not

setCurrentInstance

public boolean setCurrentInstance(int p_InstanceIndex)
Description copied from interface: IFeatureExtractor
set the index of instance which to be extracted from corpus

Specified by:
setCurrentInstance in interface IFeatureExtractor
Parameters:
p_InstanceIndex - instance index
Returns:
set success or not