ipipan.spejd.readers
Class PlainTextReader
java.lang.Object
ipipan.spejd.readers.Reader
ipipan.spejd.readers.PlainTextReader
public class PlainTextReader
- extends Reader
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ogonkified
public int ogonkified
ogonkified_total
public int ogonkified_total
PlainTextReader
public PlainTextReader()
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