de.folt.models.datamodel
Class TranslationStatistics

java.lang.Object
  extended by de.folt.models.datamodel.TranslationStatistics

public class TranslationStatistics
extends java.lang.Object

This class contains statistic data for a match. Currently it has two main properties:
Basic idea: A translation was found for a source - target language pair. Now additional statistics are computed: First how many translations does this source segment have in languages except the target language. This is done for all "non target languages"
targetMatches
iNumberOfMatchingSourcesForTarget - this number contains the number of source segments for all found target segments (inverse counter). Thus if a target segment has more than one corresponding source segment (except the found) one this value is incremented.
specifity - specifity of a translation - 0 (bad) - 1 (excellent) - the less target translation a source has the better; the less alternative source translation the better; the less traget - other language number translation the better; more "target languages" the better; a further extension could deal with looking at similarity matches too to improve this quality measure for a whole tm database

Author:
klemens

Constructor Summary
TranslationStatistics()
          Generate an empty statistics instance
TranslationStatistics(XliffDocument xliffDocument)
          Generate an empty statistics instance
 
Method Summary
 void addTargetStatistics(java.lang.String language, int iNumber)
          Set the number of matching sources for the targets found for match
 double computeSpecifity()
          Compute the specifity of the translation
 double getAtnWeight()
           
 int getiNumberOfMatchingSourcesForTarget()
           
 int getNumberOfMatchingSourcesForTarget()
          Get the number of target - source language matches
 double getSnWeight()
           
 double getSpecifity()
           
 java.util.Hashtable<java.lang.String,java.lang.Integer> getTargetMatches()
          Get the number hashtable for the source - target matches independently of the language
 int getTargetMatches(java.lang.String language)
          Get the matching number for this source segment given the source language
 double getTnWeight()
           
 void incNumberOfMatchingSourcesForTarget()
          Increase the number of target - source matches
 void incTargetStatistics(java.lang.String language)
          Increment the target language number for a given target language
static void main(java.lang.String[] args)
           
 void setAtnWeight(double atnWeight)
           
 void setiNumberOfMatchingSourcesForTarget(int iNumberOfMatchingSourcesForTarget)
           
 void setNumberOfMatchingSourcesForTarget(int numberOfMatchingSourcesForTarget)
           
 void setSnWeight(double snWeight)
           
 void setSpecifity(double specifity)
           
 void setSpecifity(float specifity)
           
 void setTargetMatches(java.util.Hashtable<java.lang.String,java.lang.Integer> targetMatches)
           
 void setTnWeight(double tnWeight)
           
 org.jdom.Element toProp()
          Create a prop-group representation of the Statistics
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslationStatistics

public TranslationStatistics()
Generate an empty statistics instance


TranslationStatistics

public TranslationStatistics(XliffDocument xliffDocument)
Generate an empty statistics instance

Method Detail

main

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

addTargetStatistics

public void addTargetStatistics(java.lang.String language,
                                int iNumber)
Set the number of matching sources for the targets found for match

Parameters:
language - the "other" target languages
iNumber - the number of matches

computeSpecifity

public double computeSpecifity()
Compute the specifity of the translation

Returns:
the specifity of the translation

getAtnWeight

public double getAtnWeight()

getiNumberOfMatchingSourcesForTarget

public int getiNumberOfMatchingSourcesForTarget()

getNumberOfMatchingSourcesForTarget

public int getNumberOfMatchingSourcesForTarget()
Get the number of target - source language matches

Returns:
the number of source segments which are translations of the target segment

getSnWeight

public double getSnWeight()

getSpecifity

public double getSpecifity()

getTargetMatches

public java.util.Hashtable<java.lang.String,java.lang.Integer> getTargetMatches()
Get the number hashtable for the source - target matches independently of the language

Returns:
the hashtable for the source - target matches independently of the language

getTargetMatches

public int getTargetMatches(java.lang.String language)
Get the matching number for this source segment given the source language

Parameters:
language - the language to search for
Returns:
the number of matching segments for this source segment given the source language

getTnWeight

public double getTnWeight()

incNumberOfMatchingSourcesForTarget

public void incNumberOfMatchingSourcesForTarget()
Increase the number of target - source matches


incTargetStatistics

public void incTargetStatistics(java.lang.String language)
Increment the target language number for a given target language

Parameters:
language - the language to increment for

setAtnWeight

public void setAtnWeight(double atnWeight)

setiNumberOfMatchingSourcesForTarget

public void setiNumberOfMatchingSourcesForTarget(int iNumberOfMatchingSourcesForTarget)

setNumberOfMatchingSourcesForTarget

public void setNumberOfMatchingSourcesForTarget(int numberOfMatchingSourcesForTarget)
Parameters:
numberOfMatchingSourcesForTarget -

setSnWeight

public void setSnWeight(double snWeight)

setSpecifity

public void setSpecifity(double specifity)

setSpecifity

public void setSpecifity(float specifity)

setTargetMatches

public void setTargetMatches(java.util.Hashtable<java.lang.String,java.lang.Integer> targetMatches)
Parameters:
targetMatches -

setTnWeight

public void setTnWeight(double tnWeight)

toProp

public org.jdom.Element toProp()
Create a prop-group representation of the Statistics

Parameters:
xliffDocument - the cliffDocument for the Statistics
Returns:
a prop-group with the statistics