1 // Machine Translation driver
2 // Copyright © 2009 The University of Chicago
8 class LinguisticaMainWindow
;
12 class mTForSortingItem
;
14 template<class V
> class Q3SortedList
;
15 template<class K
, class V
> class QMap
;
17 typedef Q3SortedList
<mTForSortingItem
> mTSortedList
;
18 typedef QMap
<int, double> IntToDouble
;
19 typedef QMap
<int, IntToDouble
*> IntToIntToDouble
;
23 LinguisticaMainWindow
* m_parent
;
24 QString m_projectDirectory
;
31 cMTModel2Norm
* m_Model2Norm
;
36 // construction/destruction.
38 cMT(LinguisticaMainWindow
*, QString
);
41 // disable default-construction, copy
45 cMT
& operator=(const cMT
& x
);
49 void readTrainingCorpus();
51 void trainModel1(int);
53 void trainModel2Norm(int, bool);
58 void logTAfterModel1();
60 void logTandAAfterModel2Norm();
63 class mTForSortingItem
{
69 // construction/destruction.
71 mTForSortingItem() : m_name(), m_type(0), m_doubleValue(0.0) { }
72 mTForSortingItem(QString name
, double value
, int type
)
73 : m_name(name
), m_type(type
),
74 m_doubleValue(m_type
== 1 ? value
: 0.0) { }
75 // destructor implicitly defined
77 // copy construction/assignment implicitly defined
81 bool operator<(const mTForSortingItem
& x
)
84 m_doubleValue
> x
.m_doubleValue
:
87 bool operator==(const mTForSortingItem
& x
)
90 m_doubleValue
== x
.m_doubleValue
: