HowManyAreAnalyzed(): use status_user_agent to report progress
[linguistica.git] / Rule.h
blobdfcf73afa893295cc2b42b20b5063b68fda5827c
1 // CRule class
2 // Copyright © 2009 The University of Chicago
3 #ifndef RULE_H
4 #define RULE_H
6 #include <QString>
7 #include "Parse.h"
8 #include "TemplateCollection.h"
9 #include "LParse.h"
11 enum RULETYPE {SUBSTITUTION, DELETION, SUBSTITUTION2FOR1};
12 class CSignatureCollection;
14 struct SigPair
17 QString Key;
18 CParse Sig1;
19 CParse Sig2;
20 int Count;
21 CParse Sig1Stems;
24 class CRule: public CLParse
25 { QString Input;
26 QString Output;
27 char LeftEnv;
28 char RightEnv;
29 RULETYPE Type;
30 CParse Examples;
31 int RuleCount;
32 TCollection<CLParse> Sigs1;
33 TCollection<CLParse> Sigs2;
37 public:
38 CRule ();
39 CRule (CRule& Rule);
40 CRule (CRule*);
41 CRule( RULETYPE, QString& strRule);
42 ~CRule();
44 // void Display(CListCtrl&, int position);
47 QString GetInput();
48 QString GetOutput();
50 void SetInput(QString);
51 void SetOutput (QString);
52 QString GetLeftEnvString();
53 char GetLeftEnv();
54 void SetLeftEnv(char);
55 QString GetRightEnvString();
56 char GetRightEnv();
57 void SetRightEnv(char);
58 RULETYPE GetType();
59 void SetType(RULETYPE);
60 int ExampleLength();
61 void AddExample(QString);
62 void SetExamples(QString& ex);
64 CParse& GetExamples();
65 int GetRuleCount();
66 CParse Display();
67 QString SpellOutRule();
68 void Clear();
69 void IncrementRuleCount(int n = 1);
71 float GetSortingQuantity() const; // number of stems that use it.
74 #endif // RULE_H