Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

recoinx.clef
Class CLEFTopicTranslator.TopicTranslatorRunnable  view CLEFTopicTranslator.TopicTranslatorRunnable download CLEFTopicTranslator.TopicTranslatorRunnable.java

java.lang.Object
  extended byrecoin.group.ComponentRunnable
      extended byrecoinx.clef.CLEFTopicTranslator.TopicTranslatorRunnable
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
CLEFTopicTranslator

protected class CLEFTopicTranslator.TopicTranslatorRunnable
extends recoin.group.ComponentRunnable

The TopicTranslatorRunnable class implements the special behavior to translate the english topic of a CLEFQuery into German, Spanish and English and complete the CLEFQuery.


Field Summary
 
Fields inherited from class recoin.group.ComponentRunnable
container, finished, support, timeStamp, worker
 
Constructor Summary
CLEFTopicTranslator.TopicTranslatorRunnable(recoin.container.RetrievalContainer rc, recoin.group.ComponentSupport cs, recoin.group.ComponentRunnable r, recoin.group.ComponentWorker worker)
          Creates a new TopicTranslatorRunnable with the specified RetrievalContainer, ComponentSupport and ComponentRunnable.
CLEFTopicTranslator.TopicTranslatorRunnable(recoin.container.RetrievalContainer rc, recoin.group.ComponentSupport cs, recoin.group.ComponentWorker worker)
          Creates a new TopicTranslatorRunnable with the specified ComponentSupport and RetrievalContainer.
CLEFTopicTranslator.TopicTranslatorRunnable(recoin.container.RetrievalContainer container, recoin.group.ComponentWorker worker)
          Creates a new TopicTranslatorRunnable with the specified RetrievalContainer.
 
Method Summary
private  org.dom4j.Document createDocument(java.io.File file)
          Returns a org.dom4j.Document that represents the specified file.
private  java.util.Iterator getTopicIterator(org.dom4j.Document doc)
           
private  java.lang.String getTopicTranslated(java.lang.String topicNumber, int language)
          Returns a translation of the topic with the specified number in the specified language.
private  java.lang.String mergeTranslations(java.lang.String[] translations)
          Merges the translations in the specified String[] into one String.
 void run()
          The run-method of this TopicTranslatorRunnable.
It takes the DocNo of the CLEFQuery and uses it to look up the different translations of the topic in the translation files.
 
Methods inherited from class recoin.group.ComponentRunnable
getParentRunnable, getThreadName, isFinished, setFinished, setParentRunnable, setUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CLEFTopicTranslator.TopicTranslatorRunnable

public CLEFTopicTranslator.TopicTranslatorRunnable(recoin.container.RetrievalContainer container,
                                                   recoin.group.ComponentWorker worker)
Creates a new TopicTranslatorRunnable with the specified RetrievalContainer.


CLEFTopicTranslator.TopicTranslatorRunnable

public CLEFTopicTranslator.TopicTranslatorRunnable(recoin.container.RetrievalContainer rc,
                                                   recoin.group.ComponentSupport cs,
                                                   recoin.group.ComponentWorker worker)
Creates a new TopicTranslatorRunnable with the specified ComponentSupport and RetrievalContainer.


CLEFTopicTranslator.TopicTranslatorRunnable

public CLEFTopicTranslator.TopicTranslatorRunnable(recoin.container.RetrievalContainer rc,
                                                   recoin.group.ComponentSupport cs,
                                                   recoin.group.ComponentRunnable r,
                                                   recoin.group.ComponentWorker worker)
Creates a new TopicTranslatorRunnable with the specified RetrievalContainer, ComponentSupport and ComponentRunnable.

Method Detail

run

public void run()
The run-method of this TopicTranslatorRunnable.
It takes the DocNo of the CLEFQuery and uses it to look up the different translations of the topic in the translation files. The translations are then stored as topics in the CLEFQuery.


getTopicTranslated

private java.lang.String getTopicTranslated(java.lang.String topicNumber,
                                            int language)
Returns a translation of the topic with the specified number in the specified language.

A Filter will look for files starting with 'DE_', 'ES_' or 'FR_' depending on the language and gather all translations for the topic. This implies that there may be several translated files for one language. The translations are merged and doublette tokens are removed before the translation is returned.


mergeTranslations

private java.lang.String mergeTranslations(java.lang.String[] translations)
Merges the translations in the specified String[] into one String. Doublettes are eliminated and the merged translation is returned.


createDocument

private org.dom4j.Document createDocument(java.io.File file)
                                   throws org.dom4j.DocumentException
Returns a org.dom4j.Document that represents the specified file.


getTopicIterator

private java.util.Iterator getTopicIterator(org.dom4j.Document doc)