HowManyAreAnalyzed(): use status_user_agent to report progress
[linguistica.git] / PrefixCollection.h
blob0c98776c9b92f2e0578d01fb15d09c6e63d86e36
1 // Prefix list for suffix/signature-based morphology discovery and display
2 // Copyright © 2009 The University of Chicago
3 #ifndef PREFIXCOLLECTION_H
4 #define PREFIXCOLLECTION_H
6 class CPrefixCollection;
8 // See the CMiniLexicon class in MiniLexicon.h for an overview of
9 // suffix/signature-based discovery of morphology.
11 #include "CollectionTemplate.h"
12 #include "StringSurrogate.h"
13 template<class K, class V> class QMap;
14 class QString;
15 namespace linguistica { namespace ui { class status_user_agent; } }
17 class CPrefixCollection: public TCollection<class CPrefix> {
18 // XXX. SuffixCollection remembers sum(dl of pointers to members).
19 // Who’s right?
20 public:
21 CPrefixCollection();
22 explicit CPrefixCollection(class CMiniLexicon* Lex);
23 ~CPrefixCollection();
25 // output to GUI.
26 // XXX. SuffixCollection has a knob for express_deletees
27 void ListDisplay(class Q3ListView* widget,
28 QMap<QString, QString>* filter,
29 linguistica::ui::status_user_agent& status_display);
31 // long-term storage.
32 void OutputPrefixes(QString filename);
33 void ReadPrefixFile(QString FileName);
35 // XXX. SuffixCollection has SortByIndex(),
36 // Get/CalculateTotalUseCount().
38 // insert.
39 CPrefix* operator<<(CStringSurrogate prefix_text);
40 CPrefix* operator<<(class CParse* prefix_text);
41 // XXX. SuffixCollection provides operator<<(CParse&)
42 CPrefix* operator<<(QString prefix_text);
43 void AddPointer(CPrefix* prefix);
44 CPrefix* AddToCollection(CParse& prefix_text);
45 CPrefix* AddToCollection(CStringSurrogate& prefix_text);
47 // clear.
48 void Empty();
49 void RemoveAll();
51 // remove.
52 bool Remove(CPrefix* prefix); ///< doesn't delete prefix
53 bool RemoveMember(CPrefix* prefix); ///< deletes prefix
54 bool RemoveMember(CStringSurrogate& prefix_text); ///< deletes prefix
55 bool RemoveMember(CStringSurrogate& prefix_text, bool delete_it);
56 void DeleteMarkedMembers();
58 // XXX. SuffixCollection has FindCombinations(),
59 // FindFactorableSuffixes().
61 // description length.
62 double GetDL_PhonologicalContent();
63 // XXX. SuffixCollection has CalculatePointersToMySuffixes()
66 #endif // PREFIXCOLLECTION_H