1 // Compound and component lists for compound discovery
2 // Copyright © 2009 The University of Chicago
3 #ifndef COMPOUNDCOLLECTION_H
4 #define COMPOUNDCOLLECTION_H
6 #include "CollectionTemplate.h"
12 typedef QList
<CStem
*> StemSet
;
13 typedef QMap
<uint
,uint
> PtrToPtr
;
14 typedef Q3PtrList
<CGrammarRule
> RuleList
;
15 typedef QMap
<QString
,RuleList
> RuleCollection
;
16 typedef QMap
<QString
,StemSet
*> ComponentMap
;
17 typedef TCollection
<CStem
> ComponentCollection
;
19 class CCompoundCollection
: public TCollection
<CCompound
>
24 double m_ComponentCount
;
26 ComponentMap m_ComponentMap
;
27 ComponentCollection m_Components
;
30 CCompoundCollection( CLexicon
* lexicon
);
31 CCompoundCollection( CMiniLexicon
* lexicon
= NULL
);
32 virtual ~CCompoundCollection();
34 ComponentMap
* GetComponentMap() { return &m_ComponentMap
; }
35 ComponentCollection
* GetComponents() { return &m_Components
;}
36 // void ChooseParseByProbability();
37 void FindMostProbableParse();
38 // void OutputCompounds ( QString );
41 void SetComponentCount( double d
) { m_ComponentCount
= d
; }
42 void SetLinkerCount( double d
) { m_LinkerCount
= d
; }
43 double GetComponentCount() { return m_ComponentCount
; }
44 double GetLinkerCount() { return m_LinkerCount
; }
45 void CheckAndRecount();
48 #endif // COMPOUNDCOLLECTION_H