Package org.languagetool.bitext
Class TabBitextReader
- java.lang.Object
-
- org.languagetool.bitext.TabBitextReader
-
- All Implemented Interfaces:
java.lang.Iterable<StringPair>
,BitextReader
- Direct Known Subclasses:
WordFastTMReader
public class TabBitextReader extends java.lang.Object implements BitextReader
Reader of simple tab-delimited bilingual files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
TabBitextReader.TabReader
-
Field Summary
Fields Modifier and Type Field Description protected java.io.BufferedReader
in
private int
lineCount
protected java.lang.String
nextLine
protected StringPair
nextPair
private java.lang.String
prevLine
protected int
sentencePos
-
Constructor Summary
Constructors Constructor Description TabBitextReader(java.lang.String filename, java.lang.String encoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
Get the current column number in the file.java.lang.String
getCurrentLine()
Get the current line of the bitext input.int
getLineCount()
Get the current line number in the file.int
getSentencePosition()
Get the current target sentence position in the file.int
getTargetColumnCount()
Get the current target column number in the file.java.util.Iterator<StringPair>
iterator()
protected @Nullable StringPair
tab2StringPair(java.lang.String line)
-
-
-
Field Detail
-
in
protected java.io.BufferedReader in
-
nextPair
protected StringPair nextPair
-
nextLine
protected java.lang.String nextLine
-
sentencePos
protected int sentencePos
-
prevLine
private java.lang.String prevLine
-
lineCount
private int lineCount
-
-
Method Detail
-
tab2StringPair
@Nullable protected @Nullable StringPair tab2StringPair(java.lang.String line)
-
iterator
public java.util.Iterator<StringPair> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<StringPair>
-
getColumnCount
public int getColumnCount()
Description copied from interface:BitextReader
Get the current column number in the file.- Specified by:
getColumnCount
in interfaceBitextReader
- Returns:
- The current column number.
-
getTargetColumnCount
public int getTargetColumnCount()
Description copied from interface:BitextReader
Get the current target column number in the file.- Specified by:
getTargetColumnCount
in interfaceBitextReader
- Returns:
- The current target column number.
-
getLineCount
public int getLineCount()
Description copied from interface:BitextReader
Get the current line number in the file.- Specified by:
getLineCount
in interfaceBitextReader
- Returns:
- The current line number.
-
getSentencePosition
public int getSentencePosition()
Description copied from interface:BitextReader
Get the current target sentence position in the file.- Specified by:
getSentencePosition
in interfaceBitextReader
- Returns:
- The current sentence position.
-
getCurrentLine
public java.lang.String getCurrentLine()
Description copied from interface:BitextReader
Get the current line of the bitext input.- Specified by:
getCurrentLine
in interfaceBitextReader
- Returns:
- The complete line (including source, if any).
-
-