1 // CMorpheme, CMorphemeListViewItem classes
2 // Copyright © 2009 The University of Chicago
7 #include "SparseVector.h"
8 #include <q3listview.h>
19 class CMorphemeListViewItem
: public Q3ListViewItem
{
20 CMorpheme
* m_morpheme
;
22 explicit CMorphemeListViewItem(Q3ListView
* parent
= 0,
23 QString text
= QString(), CMorpheme
* morphene
= 0);
27 CMorphemeListViewItem(const CMorphemeListViewItem
& x
)
28 : Q3ListViewItem(x
), m_morpheme(x
.m_morpheme
) { }
29 CMorphemeListViewItem
& operator=(const CMorphemeListViewItem
& x
)
31 Q3ListViewItem::operator=(x
);
32 m_morpheme
= x
.m_morpheme
;
36 // Qt3 list view item interface.
38 virtual QString
text(int column_index
) const;
39 virtual QString
key(int column
, bool ascending
) const;
42 class CMorpheme
: public CLParse
49 double m_DLImprovementFromSuffixes
; // this keeps track of how much improvement in Description Length
51 double m_MorphemeCount
;
59 CSparseVector m_PrecedingMorphemes
;
60 CSparseVector m_FollowingMorphemes
;
65 // arises from the suffixes that this morpheme makes possible.
67 CMorpheme( CMiniLexicon
* mini
= NULL
);
68 CMorpheme(CMorpheme
* );
69 CMorpheme (CStringSurrogate
, CMiniLexicon
* mini
= NULL
);
71 void AddSuffix ( CStringSurrogate
);
72 void AddSuffixes ( CMorphemeCollection
* );
73 void CopySuffixList ( CMorpheme
* );
74 CParse
* GetSuffixList ( );
76 void AddPrefix ( CStringSurrogate
);
77 CParse
* GetPrefixList ( );
81 void ListDisplay ( Q3ListView
* );
82 void SetDLSavings ( double);
83 double GetDLSavings ( );
85 double GetILogProb ( );
86 void SetILogProb (double);
88 void SetDLImprovementFromSuffixes ( double );
89 double GetDLImprovementFromSuffixes ( );
91 double GetFrequency ( );
92 void SetFrequency ( double );
94 void SetMorphemeCount ( double ) ;
95 double GetMorphemeCount ( );
96 void IncrementMorphemeCount ( double );
98 float GetSortingQuantity() const;
99 int GetPF () const { return m_PF
; }
100 int GetSF () const { return m_SF
; }