ULAPI  8.0
ulderivation.h
1 
7 #ifndef ULDERIVATION_H
8 #define ULDERIVATION_H
9 
10 #include "ulstring.h"
11 #include "ulinflectionrule.h"
12 #include "ulforester.h"
13 #include "ulpartofspeech.h"
14 #include "uldictionaryiterator.h"
15 
16 class ULInflector;
17 class ULDissector;
18 
28 {
29 public:
30  ULDerivation();
31  ULDerivation(const ULDerivation& other);
32  ~ULDerivation();
33 
34  ULDerivation& operator=(const ULDerivation& other);
35  bool operator==(const ULDerivation& other) const;
36  bool operator<(const ULDerivation& other) const;
37  bool operator!=(const ULDerivation& other) const;
38  void clear();
39 
40  bool initializeFromWordAndRules(const ULLanguage& language,
41  const ULDerivation& word,
42  const ULList<ULInflectionRule>& ruleList);
43 
44  ULLanguage getLanguage() const;
45  void setLanguage(const ULLanguage& newLanguage);
46  int getValidity() const;
47  void setValidity(int newValidity);
48 
49  // Root
50  uluint32 getClassID() const;
51  void setClassID(uluint32 classID);
52  const ULString& getRoot() const;
53  void setRoot(const ULString& newRoot);
54  const ULPartOfSpeech& getRootPartOfSpeech() const;
55  void setRootPartOfSpeech(const ULPartOfSpeech& newPartOfSpeech);
57  void setRootDictionaryIterator(const ULDictionaryIterator& dictionaryIterator);
58  void addFeature(const ULFeatureType& featureType, int value);
59  void addFeature(const ULFeature& feature);
60  void addStringFeature(const ULFeatureType& featureType, const ULString& stringValue);
61  void setFeature(const ULFeatureType& featureType, int value);
62  bool hasFeature(const ULFeatureType& featureType) const;
63  bool getFeature(const ULFeatureType& featureType, ULFeature& feature) const;
65  void clearRootFeatureList();
66 
67  // Derived form
68  const ULString& getDerivedForm() const;
69  void setDerivedForm(const ULString& newDerivedForm);
71  void setDerivedFormPartOfSpeech(const ULPartOfSpeech& newPartOfSpeech);
72  void appendInflectionRule(const ULInflectionRule& rule);
73  void removeFrontRule();
74  void removeBackRule();
75  void prependInflectionRule(const ULInflectionRule& rule);
77 
78  // General
79  bool finish(const ULString& originalSearchString, ULDissector *dissector, ULInflector *inflector);
80  bool isReverseExtendable() const;
81  ULString toString(bool verbose=false, bool showOnlyEndpoints=false) const;
82 
84 
85 private:
86  ULLanguage language;
87  int validity;
88  uluint32 rootClassID;
89  ULString root;
90  ULPartOfSpeech rootPartOfSpeech;
91  ULDictionaryIterator rootDictionaryIterator;
92  ULList<ULFeature> rootFeatureList;
93  ULString derivedForm;
94  ULPartOfSpeech derivedFormPartOfSpeech;
95  ULList<ULInflectionRule> inflectionRules;
96 
97  bool findFeature(const ULFeatureType& featureType, int& featureValue) const;
98 };
99 
100 #endif