public class TMXReader2
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
TMXReader2.LoadCallback
Callback for receive data from TMX.
|
static class |
TMXReader2.ParsedTu |
static class |
TMXReader2.ParsedTuv |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CT_OMEGAT
Creation Tool attribute value of OmegaT TMXs: "OmegaT"
|
static java.lang.String |
SEG_PARAGRAPH
Segment Type attribute value: "paragraph"
|
static java.lang.String |
SEG_SENTENCE
Segment Type attribute value: "sentence"
|
static org.xml.sax.EntityResolver |
TMX_DTD_RESOLVER |
static javax.xml.stream.XMLResolver |
TMX_DTD_RESOLVER_2 |
Constructor and Description |
---|
TMXReader2() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
detectCharset(java.io.File file)
Detects charset of XML file.
|
protected TMXReader2.ParsedTuv |
getTuvByLang(Language lang)
Get ParsedTuv from list of Tuv for specific language.
|
boolean |
isParagraphSegtype() |
protected void |
parseHeader(javax.xml.stream.events.StartElement element,
Language sourceLanguage) |
long |
parseISO8601date(java.lang.String str) |
protected void |
parseNote(javax.xml.stream.events.StartElement element) |
protected void |
parseProp(javax.xml.stream.events.StartElement element) |
protected void |
parseSegExtLevel1()
External TMX - level 1.
|
protected void |
parseSegExtLevel2()
External TMX - level 2.
|
protected void |
parseSegOmegaT()
OmegaT TMX - just read full text.
|
protected void |
parseTu(javax.xml.stream.events.StartElement element) |
protected void |
parseTuv(javax.xml.stream.events.StartElement element) |
void |
readTMX(java.io.File file,
Language sourceLanguage,
Language targetLanguage,
boolean isSegmentingEnabled,
boolean forceOmegaTMX,
boolean extTmxLevel2,
boolean useSlash,
TMXReader2.LoadCallback callback)
Read TMX file.
|
public static final java.lang.String SEG_PARAGRAPH
public static final java.lang.String SEG_SENTENCE
public static final java.lang.String CT_OMEGAT
public static final org.xml.sax.EntityResolver TMX_DTD_RESOLVER
public static final javax.xml.stream.XMLResolver TMX_DTD_RESOLVER_2
public static java.lang.String detectCharset(java.io.File file) throws java.io.IOException
java.io.IOException
public boolean isParagraphSegtype()
public void readTMX(java.io.File file, Language sourceLanguage, Language targetLanguage, boolean isSegmentingEnabled, boolean forceOmegaTMX, boolean extTmxLevel2, boolean useSlash, TMXReader2.LoadCallback callback) throws java.lang.Exception
java.lang.Exception
protected void parseHeader(javax.xml.stream.events.StartElement element, Language sourceLanguage)
protected void parseTu(javax.xml.stream.events.StartElement element) throws java.lang.Exception
java.lang.Exception
protected void parseTuv(javax.xml.stream.events.StartElement element) throws java.lang.Exception
java.lang.Exception
protected void parseNote(javax.xml.stream.events.StartElement element) throws java.lang.Exception
java.lang.Exception
protected void parseProp(javax.xml.stream.events.StartElement element) throws java.lang.Exception
java.lang.Exception
protected void parseSegOmegaT() throws java.lang.Exception
java.lang.Exception
protected void parseSegExtLevel1() throws java.lang.Exception
java.lang.Exception
protected void parseSegExtLevel2() throws java.lang.Exception
java.lang.Exception
protected TMXReader2.ParsedTuv getTuvByLang(Language lang)
public long parseISO8601date(java.lang.String str)