public class CorrectedWordsFileReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<java.lang.String> |
allowedWorkIDs
Allowed work IDs.
|
protected static int |
CHECKBOX |
protected static int |
CORLEM |
protected static int |
CORPOS |
protected static int |
CORSPELL |
protected static java.util.regex.Matcher |
gapWordMatcher |
protected static java.util.regex.Pattern |
gapWordPattern
Gap word matcher.
|
protected CorrectedWord |
heldCorrectedWord
Held corrected word.
|
protected int |
linesRead
Number of lines read.
|
protected static int |
SPELL |
protected static int |
STANSPELL |
static int |
TABFIELDSCOUNT
Number of fields in tabular file.
|
protected CSVFileReader |
tabFile
Tabular file holding corrected words definitions.
|
protected static int |
UPDATEDID |
protected static int |
WORDID |
protected static int |
WORKID
Fields.
|
Constructor and Description |
---|
CorrectedWordsFileReader(java.lang.String tabInputFileName,
java.util.Set<java.lang.String> allowedWorkIDs)
Create tab file reader.
|
Modifier and Type | Method and Description |
---|---|
void |
closeFile()
Close input file.
|
java.util.List<java.lang.String> |
getCorrectedWordIDs()
Return list of all corrected word IDs.
|
java.util.List<CorrectedWord> |
getCorrectedWords()
Return list of all corrected words.
|
java.util.Map<java.lang.String,CorrectedWord> |
readAllCorrectedWords()
Read all corrected words to map.
|
java.util.Map<java.lang.String,CorrectedWord> |
readCorrectedWords(int wordsToRead)
Read specified number of corrected words to map.
|
CorrectedWord |
readNextCorrectedWord()
Read next corrected word.
|
public static final int TABFIELDSCOUNT
protected static final int WORKID
protected static final int WORDID
protected static final int SPELL
protected static final int CORSPELL
protected static final int STANSPELL
protected static final int CORLEM
protected static final int CORPOS
protected static final int CHECKBOX
protected static final int UPDATEDID
protected static java.util.regex.Pattern gapWordPattern
protected static final java.util.regex.Matcher gapWordMatcher
protected int linesRead
protected CSVFileReader tabFile
protected java.util.Set<java.lang.String> allowedWorkIDs
protected CorrectedWord heldCorrectedWord
public CorrectedWordsFileReader(java.lang.String tabInputFileName, java.util.Set<java.lang.String> allowedWorkIDs) throws java.io.IOException
tabInputFileName
- Input tab file name.allowedWorkIDs
- Allowed work IDs.
If allowedWorkIDs is not null, only corrections for words whose workIDs match an entry in allowedWordIDs will be stored.
java.io.IOException
public CorrectedWord readNextCorrectedWord()
public java.util.Map<java.lang.String,CorrectedWord> readCorrectedWords(int wordsToRead)
public java.util.Map<java.lang.String,CorrectedWord> readAllCorrectedWords()
public java.util.List<CorrectedWord> getCorrectedWords()
public java.util.List<java.lang.String> getCorrectedWordIDs()
public void closeFile()