edu.stanford.nlp.international.arabic.process
Class ArabicDocumentReaderAndWriter

java.lang.Object
  extended by edu.stanford.nlp.international.arabic.process.ArabicDocumentReaderAndWriter
All Implemented Interfaces:
IteratorFromReaderFactory<java.util.List<CoreLabel>>, DocumentReaderAndWriter<CoreLabel>, java.io.Serializable

public class ArabicDocumentReaderAndWriter
extends java.lang.Object
implements DocumentReaderAndWriter<CoreLabel>

Reads newline delimited UTF-8 Arabic sentences with or without gold segmentation markers. When segmentation markers are present, this class may be used for

Author:
Spence Green
See Also:
Serialized Form

Constructor Summary
ArabicDocumentReaderAndWriter(boolean hasSegMarkers)
           
ArabicDocumentReaderAndWriter(boolean hasSegMarkers, boolean hasTags, TokenizerFactory<CoreLabel> tokFactory)
           
ArabicDocumentReaderAndWriter(boolean hasSegMarkers, TokenizerFactory<CoreLabel> tokFactory)
           
 
Method Summary
 java.util.Iterator<java.util.List<CoreLabel>> getIterator(java.io.Reader r)
          Iterate over an input document.
 void init(SeqClassifierFlags flags)
          Required, but unused.
 void printAnswers(java.util.List<CoreLabel> doc, java.io.PrintWriter pw)
          This method prints the output of the classifier to a PrintWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArabicDocumentReaderAndWriter

public ArabicDocumentReaderAndWriter(boolean hasSegMarkers)
Parameters:
hasSegMarkers - if true, input has segmentation markers

ArabicDocumentReaderAndWriter

public ArabicDocumentReaderAndWriter(boolean hasSegMarkers,
                                     TokenizerFactory<CoreLabel> tokFactory)
Parameters:
hasSegMarkers - if true, input has segmentation markers
tokFactory - a TokenizerFactory for the input

ArabicDocumentReaderAndWriter

public ArabicDocumentReaderAndWriter(boolean hasSegMarkers,
                                     boolean hasTags,
                                     TokenizerFactory<CoreLabel> tokFactory)
Parameters:
hasSegMarkers - if true, input has segmentation markers
hasTags - if true, input has morphological analyses separated by tagDelimiter.
tokFactory - a TokenizerFactory for the input
Method Detail

init

public void init(SeqClassifierFlags flags)
Required, but unused.

Specified by:
init in interface DocumentReaderAndWriter<CoreLabel>
Parameters:
flags - Flags specifying behavior

getIterator

public java.util.Iterator<java.util.List<CoreLabel>> getIterator(java.io.Reader r)
Iterate over an input document.

Specified by:
getIterator in interface IteratorFromReaderFactory<java.util.List<CoreLabel>>
Parameters:
r - Where to read objects from
Returns:
An Iterator over the objects

printAnswers

public void printAnswers(java.util.List<CoreLabel> doc,
                         java.io.PrintWriter pw)
Description copied from interface: DocumentReaderAndWriter
This method prints the output of the classifier to a PrintWriter.

Specified by:
printAnswers in interface DocumentReaderAndWriter<CoreLabel>
Parameters:
doc - The document which has answers (it has been classified)
pw - Where to send the output


Stanford NLP Group