HowManyAreAnalyzed(): use status_user_agent to report progress
[linguistica.git] / DescriptionLength.h
blob6630d43f2000ad5e7a4a9739b234a4a013ab0b67
1 // Corpus and lexicon description length bookkeeping type
2 // Copyright © 2009 The University of Chicago
3 #ifndef DESCRIPTIONLENGTH_H
4 #define DESCRIPTIONLENGTH_H
6 #include <Q3ListViewItem>
8 #include "generaldefinitions.h"
10 class QString;
12 ///////////////////////////////////////////////////////////////////////
14 // Description Length
15 //.
16 ///////////////////////////////////////////////////////////////////////
20 class CDescriptionLength
23 protected:
24 class CMiniLexicon* m_MyMiniLexicon;
25 class CLexicon* m_MyLexicon;
26 eMDL_STYLE m_MDLStyle;
27 double m_TotalDL;
29 // Stems
30 double m_NumberOfStems;
31 double m_StemsTotalPhonologicalInformationContent;
32 double m_SumOfPointersToMyStems_CorpusCount;
33 double m_SumOfPointersToMyStems_GrammarCount;
35 // Unanalyzed words
36 int m_NumberOfUnanalyzedWords;
37 double m_UnanalyzedWordsTotalPhonologicalInformationContent;
38 double m_SumOfPointersToMyUnanalyzedWords_CorpusCount;
39 double m_SumOfPointersToMyUnanalyzedWords_GrammarCount;
41 // Analyzed words
42 int m_NumberOfAnalyzedWords;
44 // Suffixes
45 double m_SuffixesTotalPhonologicalInformationContent;
47 double m_SumOfPointersToMySuffixes_CorpusCount;
48 double m_SumOfPointersToMySuffixes_GrammarCount;
51 // Suffix signatures
52 double m_SumOfInformationContentOfPointersInMySuffixSignatures;
53 double m_SumOfPointersToMySuffixSignatures_CorpusCount;
54 double m_SumOfPointersToMySuffixSignatures_GrammarCount;
56 // Corpus
57 double m_CompressedLengthOfCorpus;
58 double m_CompressedLengthOfUnanalyzedWords;
60 public:
61 CDescriptionLength( CMiniLexicon* );
62 CDescriptionLength( CLexicon* );
63 ~CDescriptionLength();
68 double TotalDL ( );
70 // Stems
71 double GetStemsTotalPhonologicalInformationContent ( );
72 double GetAffixesTotalPhonologicalInformationContent ( );
73 double GetSumOfPointersToMyStems ( eMDL_STYLE Flag = CorpusCount);
75 // double GetUnanalyzedWordsTotalPhonologicalContent ( eMDL_STYLE = CorpusCount);
76 // 'eMDL_STYLE' unused parameter
77 double GetUnanalyzedWordsTotalPhonologicalInformationContent ( );
79 double GetSumOfPointersToMyUnanalyzedWords ( eMDL_STYLE Flag = CorpusCount);
81 // Suffixes
82 double GetSuffixesTotalPhonologicalInformationContent ( );
83 double GetSumOfPointersToMySuffixes (eMDL_STYLE Flag = CorpusCount);
85 // Suffix signatures
86 double GetSumOfInformationContentOfPointersInMySuffixSignatures ();
87 double GetSumOfPointersToMySuffixSignatures ( eMDL_STYLE Flag = CorpusCount);
89 // Corpus
90 double GetCompressedLengthOfCorpus ();
92 void SetStemsTotalPhonologicalInformationContent ( double c ) { m_StemsTotalPhonologicalInformationContent = c; }
93 double CalculateCompressedLengthOfCorpus ();
96 // display
98 void DescriptionLengthListDisplay(class Q3ListView* list);
102 ///////////////////////////////////////////////////////////////////////
104 // Description Length
106 ///////////////////////////////////////////////////////////////////////
109 class CDescriptionLengthListViewItem : public Q3ListViewItem
111 public:
112 CDescriptionLengthListViewItem ( class Q3ListView* parent = NULL );
113 CDescriptionLengthListViewItem ( class Q3ListView *parent,
114 eDocumentType,
115 QString = QString::null,
116 CDescriptionLength * = NULL,
117 int index = 0 );
118 CDescriptionLengthListViewItem ( Q3ListViewItem *parent,
119 eDocumentType,
120 QString = QString::null,
121 CDescriptionLength * = NULL,
122 int index = 0 );
124 virtual QString text ( int ) const;
125 virtual QString key(int column, bool ascending) const;
126 QString GetSubstance () const;
127 eDocumentType GetSpellOutType () const { return m_SpellOutType;}
128 QString SpellOutType () const;
129 QString GetLengthOfPointersToMe () const;
130 CDescriptionLength* GetDL () const {return m_DL; }
131 QString GetLengthOfInternalPointers () const;
133 protected:
134 eDocumentType m_SpellOutType;
135 CDescriptionLength* m_DL;
136 int m_index;
139 #endif // DESCRIPTIONLENGTH_H