de.folt.models.datamodel.iate
Class IateTerminology

java.lang.Object
  extended by java.util.Observable
      extended by de.folt.models.datamodel.BasicDataSource
          extended by de.folt.models.datamodel.iate.IateTerminology
All Implemented Interfaces:
DataSource, java.util.Enumeration<MultiLingualObject>, java.util.Observer

public class IateTerminology
extends BasicDataSource

Class implements a search interface to iate @see http://iate.europa.eu. This is just for experimental tests. Using the interface requires the permission of the CEC.

 
DE
...
Sonderorganisation der Vereinten Nationen, Leben in der Gesellschaft [] Vollständiger Eintrag
CSSA
Ausschuss für den Arbeitsschutz in der Landwirtschaft
EN

Author:
klemens

Nested Class Summary
 
Nested classes/interfaces inherited from class de.folt.models.datamodel.BasicDataSource
BasicDataSource.BasicDataSourceObserver
 
Constructor Summary
IateTerminology()
           
IateTerminology(DataSourceProperties dataSourceProperties)
           
 
Method Summary
 java.lang.String getDataSourceType()
          getDataSourceType get the type of the database
 java.util.Hashtable<java.lang.String,java.util.Vector<MultiLingualObject>> getDictionaryTable()
           
 java.lang.String getQueryString()
           
static void main(java.lang.String[] args)
          main
 java.util.Vector<MultiLingualObject> searchTerm(java.lang.String term, java.lang.String sourceLanguage, java.lang.String targetLanguage)
          searchTerm search for a term in the IATE term database
 void setDictionaryTable(java.util.Hashtable<java.lang.String,java.util.Vector<MultiLingualObject>> dictionaryTable)
           
 void setQueryString(java.lang.String queryString)
           
 org.jdom.Element translate(org.jdom.Element transUnit, org.jdom.Element file, XliffDocument xliffDocument, java.lang.String sourceLanguage, java.lang.String targetLanguage, int matchSimilarity, java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
          translate translates a trans-unit given the source language, target Language and match similarity
 
Methods inherited from class de.folt.models.datamodel.BasicDataSource
addData, addMonoLingualObject, addMultiLingualObject, bAuthenticate, bPersist, bSupportMultiThreading, changedMonolingualObjects, checkIfTranslationExistsInDataSource, checkIfTranslationExistsInDataSource, cleanDataSource, clearDataSource, containsKey, containsValue, copyFrom, copyTo, createDataSource, currentTimeMillis, deleteDataSource, exportTmxFile, exportXliffFile, getAllAttributes, getChangedIds, getData, getDataSourceName, getDataSourceProperties, getDefaultDataSourceConfigurationsFileName, getFuzzyTree, getIds, getILogLevel, getLastErrorCode, getMonoLingualObjectFromId, getMonoLingualObjectFromUniqueId, getMultiLingualObjectCache, getMultiLingualObjectFromId, getMultiLingualObjectFromUniqueId, getUniqueIds, hasMoreElements, importTbxFile, importTmxFile, importXliffFile, initEnumeration, isBChanged, isBLoadAttributesLazy, isSyncDataSource, nextElement, removeData, removeDataSource, removeMonoLingualObject, removeMultiLingualObject, runFilterMethod, saveModifiedMonoLingualObject, saveModifiedMultiLingualObject, search, searchRegExp, searchWordBased, setBChanged, setBLoadAttributesLazy, setDataSourceType, setDefaultDataSourceConfigurationsFileName, setILogLevel, setILogLevel, setLastErrorCode, setMultiLingualObjectCache, setOpenTMSPropertiesFile, subSegmentResultsToGlossary, subSegmentTranslate, update, update
 
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

IateTerminology

public IateTerminology()

IateTerminology

public IateTerminology(DataSourceProperties dataSourceProperties)
Parameters:
dataSourceProperties -
Method Detail

main

public static void main(java.lang.String[] args)
main

Parameters:
args -

getDataSourceType

public java.lang.String getDataSourceType()
Description copied from interface: DataSource
getDataSourceType get the type of the database

Specified by:
getDataSourceType in interface DataSource
Overrides:
getDataSourceType in class BasicDataSource
Returns:
the data source type

getDictionaryTable

public java.util.Hashtable<java.lang.String,java.util.Vector<MultiLingualObject>> getDictionaryTable()
Returns:
the dictionaryTable

getQueryString

public java.lang.String getQueryString()
Returns:
the queryString

searchTerm

public java.util.Vector<MultiLingualObject> searchTerm(java.lang.String term,
                                                       java.lang.String sourceLanguage,
                                                       java.lang.String targetLanguage)
searchTerm search for a term in the IATE term database

Parameters:
term - the term to search
sourceLanguage - the source language
targetLanguage - the target language
Returns:
a Vector of MultiLingualObjects found

setDictionaryTable

public void setDictionaryTable(java.util.Hashtable<java.lang.String,java.util.Vector<MultiLingualObject>> dictionaryTable)
Parameters:
dictionaryTable - the dictionaryTable to set

setQueryString

public void setQueryString(java.lang.String queryString)
Parameters:
queryString - the queryString to set

translate

public org.jdom.Element translate(org.jdom.Element transUnit,
                                  org.jdom.Element file,
                                  XliffDocument xliffDocument,
                                  java.lang.String sourceLanguage,
                                  java.lang.String targetLanguage,
                                  int matchSimilarity,
                                  java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
                           throws OpenTMSException
Description copied from interface: DataSource
translate translates a trans-unit given the source language, target Language and match similarity

Specified by:
translate in interface DataSource
Overrides:
translate in class BasicDataSource
Parameters:
transUnit - the trans unit to translate to use
file - the file element currently to translate
xliffDocument - the basic xliff document
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
Returns:
the modified trans-unit with new translation
Throws:
OpenTMSException