Class TranslationStatistics

java.lang.Object
  |
  +--TranslationStatistics

class TranslationStatistics
extends java.lang.Object
implements java.lang.Runnable, UserOptions

This class computes statstics concerning the performances of the 5 types of translation

See Also:
UserOptions

Field Summary
(package private)  java.lang.String best
           
(package private)  float[] best_chosen_segments
           
(package private)  float[] best_chosen_turns
           
(package private)  int[][] best_trans
           
(package private)  java.lang.String chosen
           
(package private)  float[] chosen_segments
           
(package private)  float[] chosen_turns
           
(package private)  java.lang.String[] columnNames
           
(package private)  java.lang.String[] columns_aux
           
(package private)  java.lang.String command
           
(package private)  java.lang.String[][] data
           
(package private)  java.lang.String[] data_aux
           
(package private)  javax.swing.JDialog dialog
           
(package private)  boolean isShown
           
(package private)  javax.swing.JFrame mainframe
           
(package private)  javax.swing.table.DefaultTableModel myModel
           
(package private)  float[] segments
           
(package private)  java.lang.String[] trans
           
(package private)  float[] turns
           
(package private)  UserInterface ui
           
 
Fields inherited from interface UserOptions
DEFAULTSFILENAME, FREQUENCY_SAVE_TURNS, MAXIMUM_WORDS_STRING, NO_TURNS, REPLACEMASKSIZE, TRANSLATION_SEGMENTS
 
Constructor Summary
(package private) TranslationStatistics(javax.swing.JFrame mainframe, UserInterface ui)
          builts the window and the widgets
 
Method Summary
private  void Calculate()
          computes the statistics
private  java.lang.String DeleteDotsAndCommas(java.lang.String a_string)
           
private  void GetTurn(Judgements j)
          retrieve the data
 void HideDialog()
          dismiss the window
private  void init()
          initialize the data
private  boolean isDotOrComma(char a_char)
           
private  boolean isSelected(java.lang.String segment, int number)
           
private  void ParseBest()
           
private  void ParseChosen(int k)
           
 void run()
          starts the computations
 void ShowDialog()
          pops-up the window and starts a thread for computations
 void Update()
          called when a change is done by the user on some criteria or constraints in the user interface
private  void UpdateDialog()
          updates the view of the table
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

dialog

javax.swing.JDialog dialog

isShown

boolean isShown

best

java.lang.String best

chosen

java.lang.String chosen

trans

java.lang.String[] trans

best_trans

int[][] best_trans

segments

float[] segments

turns

float[] turns

chosen_segments

float[] chosen_segments

chosen_turns

float[] chosen_turns

best_chosen_segments

float[] best_chosen_segments

best_chosen_turns

float[] best_chosen_turns

mainframe

javax.swing.JFrame mainframe

ui

UserInterface ui

command

java.lang.String command

myModel

javax.swing.table.DefaultTableModel myModel

columnNames

final java.lang.String[] columnNames

data

final java.lang.String[][] data

columns_aux

final java.lang.String[] columns_aux

data_aux

final java.lang.String[] data_aux
Constructor Detail

TranslationStatistics

TranslationStatistics(javax.swing.JFrame mainframe,
                      UserInterface ui)
builts the window and the widgets
Method Detail

HideDialog

public void HideDialog()
dismiss the window

ShowDialog

public void ShowDialog()
pops-up the window and starts a thread for computations
See Also:
UpdateDialog()

Update

public void Update()
called when a change is done by the user on some criteria or constraints in the user interface
See Also:
UpdateDialog()

run

public void run()
starts the computations
Specified by:
run in interface java.lang.Runnable
See Also:
Calculate()

UpdateDialog

private void UpdateDialog()
updates the view of the table

init

private void init()
initialize the data

GetTurn

private void GetTurn(Judgements j)
retrieve the data
Parameters:
j - the current turn

Calculate

private void Calculate()
computes the statistics
See Also:
ParseChosen(int), ParseBest()

ParseBest

private void ParseBest()

ParseChosen

private void ParseChosen(int k)

isSelected

private boolean isSelected(java.lang.String segment,
                           int number)

isDotOrComma

private boolean isDotOrComma(char a_char)

DeleteDotsAndCommas

private java.lang.String DeleteDotsAndCommas(java.lang.String a_string)