Package org.languagetool.bitext
Class TabBitextReader
java.lang.Object
org.languagetool.bitext.TabBitextReader
- All Implemented Interfaces:
Iterable<StringPair>,BitextReader
- Direct Known Subclasses:
WordFastTMReader
Reader of simple tab-delimited bilingual files.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BufferedReaderprivate intprotected Stringprotected StringPairprivate Stringprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the current column number in the file.Get the current line of the bitext input.intGet the current line number in the file.intGet the current target sentence position in the file.intGet the current target column number in the file.iterator()protected @Nullable StringPairtab2StringPair(String line) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
in
-
nextPair
-
nextLine
-
sentencePos
protected int sentencePos -
prevLine
-
lineCount
private int lineCount
-
-
Constructor Details
-
TabBitextReader
- Parameters:
encoding- input encoding ornullto use the platform default
-
-
Method Details
-
tab2StringPair
-
iterator
- Specified by:
iteratorin interfaceIterable<StringPair>
-
getColumnCount
public int getColumnCount()Description copied from interface:BitextReaderGet the current column number in the file.- Specified by:
getColumnCountin interfaceBitextReader- Returns:
- The current column number.
-
getTargetColumnCount
public int getTargetColumnCount()Description copied from interface:BitextReaderGet the current target column number in the file.- Specified by:
getTargetColumnCountin interfaceBitextReader- Returns:
- The current target column number.
-
getLineCount
public int getLineCount()Description copied from interface:BitextReaderGet the current line number in the file.- Specified by:
getLineCountin interfaceBitextReader- Returns:
- The current line number.
-
getSentencePosition
public int getSentencePosition()Description copied from interface:BitextReaderGet the current target sentence position in the file.- Specified by:
getSentencePositionin interfaceBitextReader- Returns:
- The current sentence position.
-
getCurrentLine
Description copied from interface:BitextReaderGet the current line of the bitext input.- Specified by:
getCurrentLinein interfaceBitextReader- Returns:
- The complete line (including source, if any).
-