CMiniLexicon::FindMajorSignatures(): use log file routines
[linguistica.git] / Datum.h
blob5e3e471cae3d9b82b53f37eb7417877a9db161bd
1 // CDatum, CDatumListViewItem classes
2 // Copyright © 2009 The University of Chicago
3 #ifndef DATUM_H
4 #define DATUM_H
6 #include <qstring.h>
7 #include <q3textstream.h>
8 #include <qdatetime.h>
10 #include <math.h> //log
12 #include "Parse.h"
14 #include <q3listview.h>
16 class CStringSurrogate;
17 class CMiniLexicon;
18 class CVeryLong;
20 class CDatum;
22 class CDatumListViewItem : public Q3ListViewItem
24 public:
25 CDatumListViewItem( Q3ListView* parent = NULL );
26 CDatumListViewItem( Q3ListView *parent,
27 QString = QString::null,
28 CDatum* = NULL );
29 CDatumListViewItem( Q3ListViewItem *parent,
30 QString = QString::null,
31 CDatum* = NULL );
33 virtual QString text ( int ) const;
34 virtual QString key ( int, bool ) const;
35 CDatum* GetDatum() { return m_datum; }
36 void SetDatum( CDatum* pDatum ) { m_datum = pDatum; }
37 protected:
38 CDatum* m_datum;
42 class CDatum : public CParse
45 public:
47 //CVeryLong m_Count; //this should never get to zero.
48 //CVeryLong m_Frequency;//between 0 and 1; = this->Count / Lexicon->TotalCount
49 double m_Count; //this should never get to zero.
50 double m_Frequency;
51 int m_Index;
54 CDatum();
55 CDatum( CParse& );
56 CDatum( QChar );
57 CDatum( CStringSurrogate& );
59 void SetCount( double i );
60 double GetCount();
61 // double GetInformationContent( CMiniLexicon* Lexicon ); todo: put this back
63 void SetFrequency( float f );
64 void IncrementCount( CVeryLong& );
65 void IncrementCount();
69 #endif // DATUM_H