CMiniLexicon::FindMajorSignatures(): use log file routines
[linguistica.git] / Phone.h
blob3f2fb8b884cd44af19c9c36e247d6762d3f318c6
1 // Description length bookkeeping and display for a single phoneme
2 // Copyright © 2009 The University of Chicago
3 #ifndef PHONE_H
4 #define PHONE_H
6 class CPhoneListViewItem;
7 class CPhone;
9 #include <Q3ListViewItem>
10 #include "LParse.h"
12 #include <QString>
13 #include "StringSurrogate.h"
14 #include "generaldefinitions.h"
15 #include "CompareFunc.h"
17 class CPhoneListViewItem : public Q3ListViewItem {
18 CPhone* m_MyPhone;
19 public:
20 // construction/destruction.
22 CPhoneListViewItem(Q3ListView* parent = 0,
23 QString phoneme_text = QString(), CPhone* phoneme = 0);
24 CPhoneListViewItem(Q3ListViewItem* parent,
25 QString phoneme_text = QString(), CPhone* phoneme = 0);
26 // implicitly defined destructor
28 // copy.
30 CPhoneListViewItem(const CPhoneListViewItem& x)
31 : Q3ListViewItem(x), m_MyPhone(x.m_MyPhone) { }
32 CPhoneListViewItem& operator=(const CPhoneListViewItem& x)
34 Q3ListViewItem::operator=(x);
35 m_MyPhone = x.m_MyPhone;
36 return *this;
39 // Qt3 list view item interface.
41 virtual QString text(int column_index) const;
42 int compare(Q3ListViewItem* other, int column, bool ascending) const;
43 virtual QString key(int column, bool ascending) const;
45 // underlying unigram object.
47 CPhone* GetPhone() const { return m_MyPhone; }
48 void SetPhone(CPhone* pPhone) { m_MyPhone = pPhone; }
51 class CPhone : public CLParse
53 public:
54 CPhone(CMiniLexicon* mini = NULL);
55 CPhone(QString&, CMiniLexicon* mini = NULL);
56 CPhone(CStringSurrogate, CMiniLexicon* mini = NULL);
57 virtual ~CPhone();
58 bool operator==(CPhone& );
59 bool operator<( CPhone& );
61 double m_LogFreq;
62 double m_Frequency;
63 void SetLogFreq (double);
64 void PhoneListDisplay( Q3ListView*);
65 static ePhoneSortStyle m_SortStyle;
70 #endif // PHONE_H