ipipan.spejd.readers
Class PlainTextReader

java.lang.Object
  extended by ipipan.spejd.readers.Reader
      extended by ipipan.spejd.readers.PlainTextReader

public class PlainTextReader
extends Reader


Field Summary
 int ogonkified
           
 int ogonkified_total
           
 
Fields inherited from class ipipan.spejd.readers.Reader
AUTO, PLAIN_TXT, UNKNOWN, XCES_ANA
 
Constructor Summary
PlainTextReader()
           
 
Method Summary
 java.lang.String getNextToken(int pos)
          Utility to see what word starts from position in domain.com
 Entity loadToken()
          Move to another word and run Morfeusz over it.
 boolean nextSentence(java.io.PrintStream out)
          Move on to the next sentence.
 java.lang.String readTextFile(java.lang.String fileName, java.nio.charset.Charset inputCharset)
          Reads the content of the text file and returns it as a string
 void setFileContents(java.lang.String fileContents)
           
 
Methods inherited from class ipipan.spejd.readers.Reader
getReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ogonkified

public int ogonkified

ogonkified_total

public int ogonkified_total
Constructor Detail

PlainTextReader

public PlainTextReader()
Method Detail

readTextFile

public java.lang.String readTextFile(java.lang.String fileName,
                                     java.nio.charset.Charset inputCharset)
                              throws java.lang.Error
Reads the content of the text file and returns it as a string

Parameters:
fileName - The name of the file to read.
Returns:
The content of the file.
Throws:
marker.Error - When somethings goes wrong with the reading.
java.lang.Error

getNextToken

public java.lang.String getNextToken(int pos)
Utility to see what word starts from position in domain.com

Parameters:
pos - start word construction here
Returns:
word of up to 4 alpha characters as seen starting from pos

loadToken

public Entity loadToken()
Move to another word and run Morfeusz over it. Method returns null if end of sentence has been reached.

Specified by:
loadToken in class Reader
Returns:
next segment with interpretations polled from fileContents String

setFileContents

public void setFileContents(java.lang.String fileContents)

nextSentence

public boolean nextSentence(java.io.PrintStream out)
Description copied from class: Reader
Move on to the next sentence.

Specified by:
nextSentence in class Reader
Parameters:
out - result file
Returns:
true if there exists a next sentence