de.folt.models.documentmodel.xliff
Class XliffTranslateThread

java.lang.Object
  extended by de.folt.models.documentmodel.xliff.XliffTranslateThread
All Implemented Interfaces:
java.lang.Runnable

public class XliffTranslateThread
extends java.lang.Object
implements java.lang.Runnable

Class implements a translate operation as a thread. It should be used to parallelize translation tasks.

Author:
klemens

Constructor Summary
XliffTranslateThread(DataSource dataSource, org.jdom.Element file, java.util.List<org.jdom.Element> transunits, int iLowerBound, int iUpperBound, XliffDocument thisXliff, java.lang.String sourceLanguage, java.lang.String targetLanguage, int matchSimilarity, java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
          XliffTranslateThread translates a trans-unit given the source language, target Language and match similarity
 
Method Summary
 void run()
          translates a trans-unit given the source language, target Language and match similarity.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XliffTranslateThread

public XliffTranslateThread(DataSource dataSource,
                            org.jdom.Element file,
                            java.util.List<org.jdom.Element> transunits,
                            int iLowerBound,
                            int iUpperBound,
                            XliffDocument thisXliff,
                            java.lang.String sourceLanguage,
                            java.lang.String targetLanguage,
                            int matchSimilarity,
                            java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
                     throws OpenTMSException
XliffTranslateThread translates a trans-unit given the source language, target Language and match similarity

Parameters:
dataSource - the datasource to be used
file - the file element to translate
transunits - the transunits to translate
thisXliff - the basic xliff document
iLowerBound - start the translation process from this element
iUpperBound - stop the translation process with this element
sourceLanguage - the source language to use
targetLanguage - the target language to use
matchSimilarity - the similarity (fuzzy) match quality (0 - 100) to use
translationParameters - the hash table contains parameters which control some parameters, e.g. should header/source/target properties be written to alt-trans
Throws:
OpenTMSException
Method Detail

run

public void run()
translates a trans-unit given the source language, target Language and match similarity. The parameters are set when the thread object is created. If the trans-unit contains the attribute translate="no" the trans-unit no search is applied.

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()