sg.edu.nus.comp.nlp.ims.io
Class CPlainCorpusResultWriter

java.lang.Object
  extended by sg.edu.nus.comp.nlp.ims.io.CPlainCorpusResultWriter
All Implemented Interfaces:
IResultWriter

public class CPlainCorpusResultWriter
extends java.lang.Object
implements IResultWriter

result writer for plain corpus.

Author:
zhongzhi The disambiguated word will be surrounded with tag <x\\>, with senses and probabilities as attribution.

Field Summary
protected  ICorpus m_Corpus
           
protected  java.lang.String m_SavePath
           
 
Constructor Summary
CPlainCorpusResultWriter()
          default constructor
CPlainCorpusResultWriter(ICorpus p_Corpus)
          constructor
CPlainCorpusResultWriter(ICorpus p_Corpus, java.lang.String p_SavePath)
          constructor with initialed save directory
CPlainCorpusResultWriter(java.lang.String p_SavePath)
          constructor
 
Method Summary
 void setCorpus(ICorpus p_Corpus)
          set corpus
 void setOptions(java.lang.String[] p_Options)
          set options
 java.lang.String toString(java.lang.Object result)
          convert result to string
 void write(java.lang.Object result)
          write results
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_SavePath

protected java.lang.String m_SavePath

m_Corpus

protected ICorpus m_Corpus
Constructor Detail

CPlainCorpusResultWriter

public CPlainCorpusResultWriter()
default constructor


CPlainCorpusResultWriter

public CPlainCorpusResultWriter(java.lang.String p_SavePath)
constructor

Parameters:
p_SavePath - savepath

CPlainCorpusResultWriter

public CPlainCorpusResultWriter(ICorpus p_Corpus)
constructor

Parameters:
p_Corpus - corpus

CPlainCorpusResultWriter

public CPlainCorpusResultWriter(ICorpus p_Corpus,
                                java.lang.String p_SavePath)
constructor with initialed save directory

Parameters:
p_SavePath - save directory
Method Detail

setCorpus

public void setCorpus(ICorpus p_Corpus)
set corpus

Parameters:
p_Corpus - corpus

setOptions

public void setOptions(java.lang.String[] p_Options)
Description copied from interface: IResultWriter
set options

Specified by:
setOptions in interface IResultWriter
Parameters:
p_Options - options

toString

public java.lang.String toString(java.lang.Object result)
Description copied from interface: IResultWriter
convert result to string

Specified by:
toString in interface IResultWriter
Parameters:
result - classification result
Returns:
string format

write

public void write(java.lang.Object result)
           throws java.io.IOException
Description copied from interface: IResultWriter
write results

Specified by:
write in interface IResultWriter
Parameters:
result - result
Throws:
java.io.IOException - exception while saving result