ULAPI  8.0
ulpartofspeech.h
1 
7 #ifndef ULPARTOFSPEECH_H
8 #define ULPARTOFSPEECH_H
9 
10 #ifndef __STDC_LIMIT_MACROS
11 #define __STDC_LIMIT_MACROS
12 #endif
13 #include <stdint.h>
14 
15 #include "ulerror.h"
16 #include "ulstring.h"
17 #include "ullanguage.h"
18 #include "ulpartofspeechcategory.h"
19 #include "ulpartofspeechsubcategory.h"
20 #include "ulfeature.h"
21 #include "ulnumber.h"
22 #include "ulgender.h"
23 #include "ulformality.h"
24 #include "ulcase.h"
25 #include "ultense.h"
26 #include "ulperson.h"
27 #include "ulmood.h"
28 #include "ulaspect.h"
29 #include "ultransitivity.h"
30 
38 {
39 public:
41  ULPartOfSpeech(const ULPartOfSpeech& other);
42  virtual ~ULPartOfSpeech();
43 
44  void clear();
46  bool operator==(const ULPartOfSpeech& other) const;
47  bool operator!=(const ULPartOfSpeech& other) const;
48  bool operator<(const ULPartOfSpeech& other) const;
49  uluint32 hash(uluint32 tableSize) const;
50 
51  // Accessors
52  ULNumber getNumber() const;
53  ULGender getGender() const;
55  ULCase getCase() const;
56  ULTense getTense() const;
57  ULPerson getPerson() const;
58  ULFormality getFormality() const;
59  ULMood getMood() const;
60  ULAspect getAspect() const;
61  ULTransitivity getTransitivity() const;
62 
63  bool isRootPartOfSpeech() const;
64 
66  void setPartOfSpeechCategory(const ULPartOfSpeechCategory& category);
67 
68  void addFeature(const ULFeatureType& featureType, int value);
69  void addFeature(const ULFeature& feature);
70  void addStringFeature(const ULFeatureType& featureType, const ULString& stringValue);
71  void setFeature(const ULFeatureType& featureType, int value);
72  bool hasFeature(const ULFeatureType& featureType) const;
73  bool getFeature(const ULFeatureType& featureType, ULFeature& feature) const;
74 
75  ULString toString() const;
76 
77  const ULList<ULFeature>& getFeatureList() const;
78 
79 protected:
81  // The feature list is kept sorted for efficient comparison.
83  bool findFeature(const ULFeatureType& featureType, int& featureValue) const;
84 };
85 
86 #endif
87