|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
de.folt.models.documentmodel.document.XmlDocument
de.folt.models.documentmodel.xliff.XliffDocument
public class XliffDocument
This class implements several utility functions for reading the main elements
and attributes of a XLIFF document.
A key method is the translate method. It translates the xliff document based
on source language and target language and similarity using a specific data
source. The method supports multi-threading. Depending on the number of
processors available it distributes the translation of a set of trans-unit
towards several processors. The version currently supports Xliff 1.1 and 1.2.
When using the JDOM Element methods like getChild etc. it is recommended
explicitly setting the NAMESPACE. Example: getChild("target",
this.getNamespace()) or Element source = new Element("source",
this.getNamespace()); As Xliff 1.2 may contain a reference to the Xliff
specification like
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2"
xmlns:tek="http://www.tektronix.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2
xliff-core-1.2-strict.xsd http://www.tektronix.com tek_code_trial.xsd"
version="1.2">
this ensures correct getting and setting of the elements.
For details of XLIFF: XLIFF
Currently JDOM is used for parsing the XML XLIFF documents.
| Constructor Summary | |
|---|---|
XliffDocument()
|
|
XliffDocument(java.io.File file)
|
|
XliffDocument(java.lang.String fileName)
|
|
| Method Summary | |
|---|---|
void |
addAltTrans(org.jdom.Element transunit,
org.jdom.Element alttrans)
addAltTrans adds an alt-trans to the given trans-unit |
org.jdom.Element |
addAltTrans(org.jdom.Element transUnit,
MonoLingualObject sourceMono,
MonoLingualObject targetMono,
int iMatchquality)
addAltTrans a a new alt-trans using source = sourceMono and target = targetMono |
org.jdom.Element |
addAltTrans(org.jdom.Element transUnit,
MonoLingualObject sourceMono,
java.util.Vector<MonoLingualObject> targetmonos,
int iMatchquality,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
addAltTrans a a new alt-trans using source = sourceMono and target = targetMono |
void |
addAltTransSorted(org.jdom.Element transunit,
org.jdom.Element alttrans)
addAltTransSorted adds an alt-trans to the given trans-unit by searching for the next lower match-quality |
void |
addPhase(org.jdom.Element phaseGroup,
java.lang.String company,
java.lang.String processName,
java.lang.String tool,
java.lang.String jobId,
java.lang.String contactName,
java.lang.String contactEmail,
java.lang.String contactPhone)
addPhase adds a new phase to a phase group - Example: |
org.jdom.Element[] |
addSubSegmentTranslationToGlossary(org.jdom.Element file,
java.lang.String sourceTerm,
java.lang.String targetTerm)
addSubSegmentTranslationToGlossary add a phrase (source and target) to the internal dictionary |
org.jdom.Element[] |
addSubSegmentTranslationToGlossary(org.jdom.Element file,
java.util.Vector<java.lang.String> sourceTerms,
java.util.Vector<java.lang.String> targetTerms)
addSubSegmentTranslationToGlossary |
boolean |
bAltTransContained(org.jdom.Element transUnit,
MonoLingualObject sourceMono,
MonoLingualObject targetmono)
bAltTransContained check if a source mono / target monos combination already exists in the trans-unit |
boolean |
bAltTransContained(org.jdom.Element transUnit,
MonoLingualObject sourceMono,
java.util.Vector<MonoLingualObject> targetmonos)
bAltTransContained check if a source mono / target monos combination already exists in the trans-unit |
org.jdom.Element |
convertMonoLingualObjectToElement(org.jdom.Element element,
MonoLingualObject mono)
convertMonoLingualObjectToElement converts a MonoLingualObject to an Element converting the formatted segment to content |
org.jdom.Element |
convertMonoLingualObjectToSource(MonoLingualObject mono)
convertMonoLingualObjectToSource converts a MonoLingualObject to a source element converting the formatted segment to content |
org.jdom.Element |
convertMonoLingualObjectToTarget(MonoLingualObject mono)
convertMonoLingualObjectToTarget converts a MonoLingualObject to a target element converting the formatted segment to content |
java.lang.String |
convertTmxSegStringToXliffString(java.lang.String segstring)
convertTmxSegStringToXliffString converts a tmx seg String to a Xliff segment, esp. type= becomes ctype= |
boolean |
existsTranslationBasedOnOrigin(org.jdom.Element transUnit,
java.lang.String originValue)
existsTranslationBasedOnOrigin check if for a given origin value a translation exists |
boolean |
exportInternalOpenTMSTerminology(java.lang.String tbxDocumentName)
exportInternalOpenTMSTerminology export the internal term dictionary of the xliff file to a tbx file; it creates first a new tbxDocument tbxDocumentName if it does not exist; otherwise appends entries to existing tbx document; it exports all the terms in all files contained in the xliff document. |
boolean |
exportToTextFile(org.jdom.Element file,
java.lang.String fileName,
boolean removeCRLF,
boolean removeTags)
exportToTextFile exports the xliff file to a simple line feed separated text file |
java.util.List<org.jdom.Element> |
getAllTransUnitsList(org.jdom.Element body)
getAllTransUnitsList get all the trans units of a body including contained in groups |
java.lang.String |
getAltTransId(org.jdom.Element altrans)
getAltTransId |
java.util.List<org.jdom.Element> |
getAltTransList(org.jdom.Element transUnit)
getAltTransList the alt-trans elements of a trans-unit |
java.lang.String |
getAltTransMultiCreationId(org.jdom.Element altrans)
getAltTransMultiId get the creation-id of a an alt-trans match Example: <alt-trans><<source...>... |
org.jdom.Element |
getBody(org.jdom.Element file)
getBody get the header of the xliff file element |
java.util.List<org.jdom.Element> |
getFiles()
getFiles the file (s) elements of an xliff file |
java.lang.String |
getFileSourceLanguage(org.jdom.Element file)
getFileSourceLanguage gets the source language of a file element |
java.lang.String |
getFileTargetLanguage(org.jdom.Element file)
getFileTargetLanguage gets the target language of a file element |
java.lang.String |
getGlossary(org.jdom.Element file)
getGlossary get the glossary element text |
java.util.List<org.jdom.Element> |
getGroupTransUnitList(org.jdom.Element body)
getTransUnitList get all the trans units of all the groups in the body |
org.jdom.Element |
getHeader(org.jdom.Element file)
getHeader get the header of the xliff file element |
java.lang.String |
getLanguage(org.jdom.Element element)
getLanguage gets the language of an element |
float |
getMatchQualityAsFloat(org.jdom.Element alttrans)
getMatchQualityAsFloat gets the match quality of an alt-trans element |
int |
getMatchQualityAsInt(org.jdom.Element alttrans)
getMatchQualityAsInt gets the match quality of an alt-trans element |
org.jdom.Element |
getPhaseGroup(org.jdom.Element header)
getPhaseGroup get the phase group of the header |
java.util.List<org.jdom.Element> |
getPhases(org.jdom.Element phaseGroup)
getPhases get all the phases for a file element resp. its header |
org.jdom.Element |
getRoot()
getRoot get the root element of the XmlDocument |
org.jdom.Element |
getSklFile(org.jdom.Element header)
getSklFile get either the external or internal skl file |
java.lang.String |
getSourceLanguage()
|
java.lang.String |
getSourceLanguage(org.jdom.Element file)
getSourceLanguage get source language from file element |
java.lang.String |
getTargetLanguage()
|
java.lang.String |
getTargetLanguage(org.jdom.Element file)
getTargetLanguage get target language from file element |
java.util.List<org.jdom.Element> |
getTransUnitList(org.jdom.Element body)
getTransUnitList get all the trans units of a body |
java.util.List<org.jdom.Element> |
getTransUnitListNoNS(org.jdom.Element body)
getTransUnitList3 get all the trans units of a body - no namespace used |
java.util.Vector<PhraseTranslateResult> |
getTransUnitPhraseEntries(org.jdom.Element transUnit)
getTransUnitPhraseEntries return the phrase entries of the entry Example: <prop-group name="subSegmentTranslate:C:\Program Files\OpenTMS\test\editor\sample.tbx"> <prop xml:lang="de" prop-type="source">Vorwort</prop> <prop xml:lang="en" prop-type="target">Preface</prop> </prop-group></pre> |
org.jdom.Element |
getTransUnitSegSource(org.jdom.Element transUnit)
getTransUnitSegSource returns the seg-source element of a trans-unit |
org.jdom.Element |
getTransUnitSource(org.jdom.Element transUnit)
getTransUnitSource returns the source element of a trans-unit |
org.jdom.Element |
getTransUnitTarget(org.jdom.Element transUnit)
getTransUnitTarget returns the target element of a trans-unit |
org.jdom.Element |
getXliffBody(org.jdom.Element file)
getXliffBody gets the body of a file element |
org.jdom.Element |
getXliffHeader(org.jdom.Element file)
getXliffHeader gets the header of a file element |
java.lang.String |
getXliffVersion()
getXliffVersion get the TMX version of the tmx docuemnt |
boolean |
isExternalSkl(org.jdom.Element skl)
isExternalSkl determine if external or internal skl file |
org.jdom.Element |
linguisticPropertiesToProp(java.lang.String name,
LinguisticProperties properties)
linguisticPropertiesToProp converts Linguistic Properties to a prop-group |
org.jdom.Document |
loadXmlFile(java.io.File newFile)
loadXmlFile loads an XML file |
org.jdom.Document |
loadXmlFile(java.lang.String filename)
loadXmlFile loads an XML file as a document |
static void |
main(java.lang.String[] args)
main |
void |
removeAllAltTransElements(org.jdom.Element body)
removeAllAltTransElements remove all the alt-trans from the all trans-units |
void |
removeAllTargetAndAltTransElements(org.jdom.Element body)
removeAllTargetAndAltTransElements remove all the alt-trans and targets from the all trans-units |
void |
removeAllTargetElements(org.jdom.Element body)
removeAllTargetElements remove all the targets from the all trans-units |
boolean |
removeTranslationBasedOnOrigin(org.jdom.Element transUnit,
java.lang.String originValue)
removeTranslationBasedOnOrigin removes an alt-trans element based on the origin attribute |
void |
setRoot(org.jdom.Element root)
|
void |
setSourceLanguage(org.jdom.Element file,
java.lang.String sourceLanguage)
setSourceLanguage set the source language of a file element |
void |
setSourceLanguage(java.lang.String sourceLanguage)
|
void |
setTargetLanguage(org.jdom.Element file,
java.lang.String targetLanguage)
setSourceLanguage set the target language of a file element |
void |
setTargetLanguage(java.lang.String targetLanguage)
|
void |
subSegmentTranslate(DataSource dataSource,
java.util.List<org.jdom.Element> transunits,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
subSegmentTranslate translates an xliff document based on the source and target language provided on a sub segment bases. |
void |
subSegmentTranslate(DataSource dataSource,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
translate translates an xliff document based on the source and target language provided |
void |
subSegmentTranslate(java.lang.String dataSourceName,
java.lang.String sourceLanguage,
java.lang.String targetLanguage)
subSegmentTranslate translates an xliff document based on the source and target language provided; the translation parameters are set to null. |
void |
translate(DataSource dataSource,
org.jdom.Element file,
java.util.List<org.jdom.Element> transunits,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
int matchSimilarity,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
translate translates an xliff document based on the source and target language provided. |
void |
translate(DataSource dataSource,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
int matchSimilarity,
int iMaxThreads,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
translate translates an xliff document based on the source and target language provided |
void |
translate(java.lang.String dataSourceName,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
int matchSimilarity,
int iMaxThreads)
translate translates an xliff document based on the source and target language provided;; the translation parameters are set to null. |
MultiLingualObject |
transUnitToMultiLingualObject(org.jdom.Element element)
transUnitToMultiLingualObject creates a MUL from source and target of a trans-unit if approved |
MultiLingualObject |
transUnitToMultiLingualObject(org.jdom.Element element,
boolean bLoadAllTargets)
transUnitToMultiLingualObject creates a MUL from source and target of a trans-unit if approved |
static int |
updateXliffDocument(java.io.File sourceDocument,
java.io.File updateDocument)
updateXliffDocument updates a given xliff document with an update xliff document. |
static int |
updateXliffDocument(java.lang.String sourceDocument,
java.lang.String updateDocument)
updateXliffDocument updates a given xliff document with an update xliff document. |
| Methods inherited from class java.util.Observable |
|---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XliffDocument()
public XliffDocument(java.io.File file)
file - public XliffDocument(java.lang.String fileName)
fileName - | Method Detail |
|---|
public static void main(java.lang.String[] args)
args -
public static int updateXliffDocument(java.io.File sourceDocument,
java.io.File updateDocument)
sourceDocument - the document to updateupdateDocument - the document containing changed entries
public static int updateXliffDocument(java.lang.String sourceDocument,
java.lang.String updateDocument)
sourceDocument - the document to updateupdateDocument - the document containing changed entries
public void addAltTrans(org.jdom.Element transunit,
org.jdom.Element alttrans)
transunit - the transunitalttrans - the alt-trans to add
public org.jdom.Element addAltTrans(org.jdom.Element transUnit,
MonoLingualObject sourceMono,
MonoLingualObject targetMono,
int iMatchquality)
transUnit - the trans-unit sourceMono - source mono lingual objecttargetMono - target mono lingual objectiMatchquality - the matchquality
public org.jdom.Element addAltTrans(org.jdom.Element transUnit,
MonoLingualObject sourceMono,
java.util.Vector<MonoLingualObject> targetmonos,
int iMatchquality,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
transUnit - the trans-unit sourceMono - source mono lingual objecttargetmonos - target mono lingual objectsiMatchquality - the matchqualitytranslationParameters - a hash table containing key value pairs defining whih
attrobutes etc. to add.
public void addAltTransSorted(org.jdom.Element transunit,
org.jdom.Element alttrans)
transunit - the trans-unitalttrans - the alt-trans to add sorted
public void addPhase(org.jdom.Element phaseGroup,
java.lang.String company,
java.lang.String processName,
java.lang.String tool,
java.lang.String jobId,
java.lang.String contactName,
java.lang.String contactEmail,
java.lang.String contactPhone)
phaseGroup - the phase groupcompany - the company nameprocessName - the process name - if null "OpenTMS Translate" will be usedtool - the tool - if null "OpenTMS Translate" will be usedjobId - - job-idcontactName - -contact-namecontactEmail - contact-emailcontactPhone - -contact phone
public org.jdom.Element[] addSubSegmentTranslationToGlossary(org.jdom.Element file,
java.lang.String sourceTerm,
java.lang.String targetTerm)
file - the file element where to add the phrasesourceTerm - the source termtargetTerm - the target term
public org.jdom.Element[] addSubSegmentTranslationToGlossary(org.jdom.Element file,
java.util.Vector<java.lang.String> sourceTerms,
java.util.Vector<java.lang.String> targetTerms)
file - sourceTerms - targetTerms -
public boolean bAltTransContained(org.jdom.Element transUnit,
MonoLingualObject sourceMono,
MonoLingualObject targetmono)
transUnit - the trans-unit to checksourceMono - the source mono - sourceMono.getFormattedSegment() used for
comparisontargetmono - the target mono - translation
public boolean bAltTransContained(org.jdom.Element transUnit,
MonoLingualObject sourceMono,
java.util.Vector<MonoLingualObject> targetmonos)
transUnit - the trans-unit to checksourceMono - the source mono - sourceMono.getFormattedSegment() used for
comparisontargetmonos - the target monos - targetmonos.get(i).getFormattedSegment()
used for comparison; identical targets are removed from
targetmonos vector
public org.jdom.Element convertMonoLingualObjectToElement(org.jdom.Element element,
MonoLingualObject mono)
throws OpenTMSException
element - mono -
OpenTMSException
public org.jdom.Element convertMonoLingualObjectToSource(MonoLingualObject mono)
throws OpenTMSException
mono - the mono lingual object
OpenTMSException
public org.jdom.Element convertMonoLingualObjectToTarget(MonoLingualObject mono)
throws OpenTMSException
mono - the mono lingual object
OpenTMSExceptionpublic java.lang.String convertTmxSegStringToXliffString(java.lang.String segstring)
segstring - the tuv segment
public boolean existsTranslationBasedOnOrigin(org.jdom.Element transUnit,
java.lang.String originValue)
transUnit - the tran-unit to checkoriginValue - the value of the origin attribute
public boolean exportInternalOpenTMSTerminology(java.lang.String tbxDocumentName)
tbxDocumentName - the output tbx file name
public boolean exportToTextFile(org.jdom.Element file,
java.lang.String fileName,
boolean removeCRLF,
boolean removeTags)
file - the file to export in the xliff documentfileName - the file name to export toremoveCRLF - true if CR/LF in segments should be removedremoveTags - true if tags in segments should be removed
public java.util.List<org.jdom.Element> getAllTransUnitsList(org.jdom.Element body)
body - the body element
public java.lang.String getAltTransId(org.jdom.Element altrans)
altrans -
public java.util.List<org.jdom.Element> getAltTransList(org.jdom.Element transUnit)
transUnit - the trans-unit element
public java.lang.String getAltTransMultiCreationId(org.jdom.Element altrans)
<alt-trans><<source...>...<target...>...
<prop-group name="MULTI-624649fa-7e65-42ee-928d-aa2b10b12f27"><prop prop-value="creationid">1233c020bc55054_klemens</prop><prop prop-value="usagecount">0</prop><prop prop-value="entrynumber">21477</prop><prop prop-value="datatype">125447</prop><prop prop-value="changeid">1233c020bc55054_klemens</prop></prop-group>
</alt-trans> getAltTransMultiId(alt-trans) will return "1233c020bc55054_klemens"
altrans - the alt-trans element to search in
public org.jdom.Element getBody(org.jdom.Element file)
file - the file element
public java.util.List<org.jdom.Element> getFiles()
public java.lang.String getFileSourceLanguage(org.jdom.Element file)
file - the file element
public java.lang.String getFileTargetLanguage(org.jdom.Element file)
file - the file element
public java.lang.String getGlossary(org.jdom.Element file)
file - the header which contains the glossary
public java.util.List<org.jdom.Element> getGroupTransUnitList(org.jdom.Element body)
body - the body element
public org.jdom.Element getHeader(org.jdom.Element file)
file - the file element
public java.lang.String getLanguage(org.jdom.Element element)
element - the element with a language code
public float getMatchQualityAsFloat(org.jdom.Element alttrans)
alttrans - the alt-trans element
public int getMatchQualityAsInt(org.jdom.Element alttrans)
alttrans - the alt-trans element
public org.jdom.Element getPhaseGroup(org.jdom.Element header)
header -
public java.util.List<org.jdom.Element> getPhases(org.jdom.Element phaseGroup)
phaseGroup - the phase group
public org.jdom.Element getRoot()
XmlDocument
getRoot in class XmlDocumentpublic org.jdom.Element getSklFile(org.jdom.Element header)
header - the header element
public java.lang.String getSourceLanguage()
public java.lang.String getSourceLanguage(org.jdom.Element file)
file - the file element
public java.lang.String getTargetLanguage()
public java.lang.String getTargetLanguage(org.jdom.Element file)
file - the file element
public java.util.List<org.jdom.Element> getTransUnitList(org.jdom.Element body)
body - the body element
public java.util.List<org.jdom.Element> getTransUnitListNoNS(org.jdom.Element body)
body - the body element
public java.util.Vector<PhraseTranslateResult> getTransUnitPhraseEntries(org.jdom.Element transUnit)
<prop-group name="subSegmentTranslate:C:\Program Files\OpenTMS\test\editor\sample.tbx"> <prop xml:lang="de" prop-type="source">Vorwort</prop> <prop xml:lang="en" prop-type="target">Preface</prop> </prop-group></pre>
transUnit - the trans-unit with the phrase entries
public org.jdom.Element getTransUnitSegSource(org.jdom.Element transUnit)
transUnit - the trans-unit element
public org.jdom.Element getTransUnitSource(org.jdom.Element transUnit)
transUnit - the trans-unit element
public org.jdom.Element getTransUnitTarget(org.jdom.Element transUnit)
transUnit - the trans-unit element
public org.jdom.Element getXliffBody(org.jdom.Element file)
file - the file element
public org.jdom.Element getXliffHeader(org.jdom.Element file)
file - the file element
public java.lang.String getXliffVersion()
public boolean isExternalSkl(org.jdom.Element skl)
skl - the skl File element from getSklFile(Element header)
public org.jdom.Element linguisticPropertiesToProp(java.lang.String name,
LinguisticProperties properties)
name - the name for the new prop-groupproperties - the linguistic properties
public org.jdom.Document loadXmlFile(java.io.File newFile)
XmlDocument
loadXmlFile in class XmlDocumentnewFile - the File of the XML File
public org.jdom.Document loadXmlFile(java.lang.String filename)
XmlDocument
loadXmlFile in class XmlDocumentfilename - the file name of the XML file
public void removeAllAltTransElements(org.jdom.Element body)
body - the body element of the file elementpublic void removeAllTargetAndAltTransElements(org.jdom.Element body)
body - the body element of the file elementpublic void removeAllTargetElements(org.jdom.Element body)
body - the body element of the file element
public boolean removeTranslationBasedOnOrigin(org.jdom.Element transUnit,
java.lang.String originValue)
transUnit - the transunit to checkoriginValeu - the value for the origin attribute
public void setRoot(org.jdom.Element root)
root - the root to set
public void setSourceLanguage(org.jdom.Element file,
java.lang.String sourceLanguage)
file - the file elementsourceLanguage - the source languagepublic void setSourceLanguage(java.lang.String sourceLanguage)
sourceLanguage - the sourceLanguage to set
public void setTargetLanguage(org.jdom.Element file,
java.lang.String targetLanguage)
file - the file elementtargetLanguage - the target languagepublic void setTargetLanguage(java.lang.String targetLanguage)
targetLanguage - the targetLanguage to set
public void subSegmentTranslate(DataSource dataSource,
java.util.List<org.jdom.Element> transunits,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
throws OpenTMSException
dataSource - the data source to usetransunits - the trans-units to translatesourceLanguage - the source language to usetargetLanguage - the target language to usetranslationParameters - a hash table with additional translation parameters; usage is
up to the implementation
OpenTMSXException
OpenTMSException
public void subSegmentTranslate(DataSource dataSource,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
throws OpenTMSException
dataSource - the data source to usesourceLanguage - the source language to usetargetLanguage - the target language to usematchSimilarity - the similarity (fuzzy) match quality (0 - 100) to useiMaxThreads - the maximum number of threads to use / -1 = use as many
threads as processors available; 0 = do not create a thread
(run in main process); 1 run in main process; > 1 run dividing
trans-units to translate in several threads; maximum is the
number of processors; if number of trans-units less that
processors use processor = 1translationParameters - the translation parameters to use; some paramaters supported
(written to the phasegroup):OpenTMSXException
OpenTMSException
public void subSegmentTranslate(java.lang.String dataSourceName,
java.lang.String sourceLanguage,
java.lang.String targetLanguage)
throws OpenTMSException
dataSourceName - the name of data source to usesourceLanguage - the source language to usetargetLanguage - the target language to use
OpenTMSXException
OpenTMSException
public void translate(DataSource dataSource,
org.jdom.Element file,
java.util.List<org.jdom.Element> transunits,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
int matchSimilarity,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
throws OpenTMSException
dataSource - the data source to usefile - transunits - the trans-units to translatesourceLanguage - the source language to usetargetLanguage - the target language to usematchSimilarity - the similarity (fuzzy) match quality (0 - 100) to usetranslationParameters - a hashtable with additional translation paramters; usage is up
to the implementation
OpenTMSXException
OpenTMSException
public void translate(DataSource dataSource,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
int matchSimilarity,
int iMaxThreads,
java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
throws OpenTMSException
dataSource - the data source to usesourceLanguage - the source language to usetargetLanguage - the target language to usematchSimilarity - the similarity (fuzzy) match quality (0 - 100) to useiMaxThreads - the maximum number of threads to use / -1 = use as many
threads as processors available; 0 = do not create a thread
(run in main process); 1 run in main process; > 1 run dividing
trans-units to translate in several threads; maximum is the
number of processors; if number of trans-units less that
processors use processor = 1translationParameters - the translation parameters to use; some paramaters supported
(written to the phasegroup):OpenTMSXException
OpenTMSException
public void translate(java.lang.String dataSourceName,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
int matchSimilarity,
int iMaxThreads)
throws OpenTMSException
dataSourceName - the name of data source to usesourceLanguage - the source language to usetargetLanguage - the target language to usematchSimilarity - the similarity (fuzzy) match quality (0 - 100) to useiMaxThreads - the maximum nuber of threads (processors) to use for
translation
OpenTMSXException
OpenTMSExceptionpublic MultiLingualObject transUnitToMultiLingualObject(org.jdom.Element element)
element - the transunit
public MultiLingualObject transUnitToMultiLingualObject(org.jdom.Element element,
boolean bLoadAllTargets)
element - the transunitbLoadAllTargets - if true loads all target translation irrespectively if
approved or not
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||