1 // Description length bookkeeping and display for a phoneme pair
2 // Copyright © 2009 The University of Chicago
7 class CBiphoneListViewItem
;
9 #include <Q3ListViewItem>
13 #include "generaldefinitions.h"
15 class CBiphoneListViewItem
: public Q3ListViewItem
{
16 CBiphone
* m_MyBiphone
;
18 explicit CBiphoneListViewItem(Q3ListView
* parent
= 0,
19 QString bigram_text
= QString(), CBiphone
* bigram
= 0);
20 explicit CBiphoneListViewItem(Q3ListViewItem
* parent
,
21 QString bigram_text
= QString(), CBiphone
* bigram
= 0);
25 CBiphoneListViewItem(const CBiphoneListViewItem
& x
)
26 : Q3ListViewItem(x
), m_MyBiphone(x
.m_MyBiphone
) { }
27 CBiphoneListViewItem
& operator=(const CBiphoneListViewItem
& x
)
29 Q3ListViewItem::operator=(x
);
30 m_MyBiphone
= x
.m_MyBiphone
;
34 // Qt3 list view item interface.
36 virtual QString
text(int column_index
) const;
37 int compare(Q3ListViewItem
* other
, int column
, bool ascending
) const;
39 // underlying biphone object.
41 CBiphone
* GetBiphone() const { return m_MyBiphone
; }
42 void SetBiphone(CBiphone
* pBiphone
) { m_MyBiphone
= pBiphone
; }
45 class CBiphone
: public CLParse
{
47 static enum eBiphoneSortStyle m_SortStyle
;
56 double m_NormalizedMI
;
57 class CPhone
* m_MyFirst
;
58 class CPhone
* m_MySecond
;
60 // construction/destruction.
63 CBiphone(QString unigrams
);
68 CBiphone(const CBiphone
& x
);
69 CBiphone
& operator=(const CBiphone
&);
73 bool operator==(const CBiphone
& x
);
74 bool operator<(const CBiphone
& x
);
78 void SetMI (double value
);
79 double GetMI() { return m_MI
; }
80 void SetLogFreq(double d
) { m_LogFreq
= d
; }
83 void BiphoneListDisplay(Q3ListView
* widget
);