ULAPI  8.0
ulinflector.h
1 
7 #ifndef ULINFLECTOR_H
8 #define ULINFLECTOR_H
9 
10 #include "ulworker.h"
11 #include "ultense.h"
12 #include "ulperson.h"
13 #include "ullanguagedatasource.h"
14 #include "uldictionarydatasource.h"
15 #include "ulderivation.h"
16 
23 class ULInflector : public ULWorker
24 {
25  friend class ULDerivation;
26 
27 public:
28  ULInflector();
29  ULInflector(const ULInflector& other);
30  virtual ~ULInflector();
31 
32  ULInflector& operator=(const ULInflector& other);
33  void clear();
34 
35  // Factory
36  static ULInflector *createInflector(const ULLanguage& language);
37 
38  // Accessors
39  const ULLanguage& getLanguage() const;
44 
45  // ULWorker interfaces
46  virtual bool isServiceAvailable(const ULServiceDescriptor& service);
47  virtual void getAvailableServices(ULList<ULServiceDescriptor>& services);
48 
49  // The inflector's core services
50  virtual ULError inflect(const ULString& word,
51  const ULPartOfSpeech& sourcePartOfSpeech,
52  const ULPartOfSpeech& targetPartOfSpeech,
53  uluint32 maxDerivationLength,
54  ULList<ULDerivation>& derivationList);
55 
56  virtual ULError inflect(const ULDerivation& verb,
57  const ULPartOfSpeech& targetPartOfSpeech,
58  uluint32 maxDerivationLength,
59  ULList<ULDerivation>& derivationList);
60 
61 protected:
64 
65  ULError inflectWithWord(const ULString& originalSearchString,
66  const ULDerivation& word,
67  const ULPartOfSpeech& targetPartOfSpeech,
68  uluint32 maxDerivationLength,
69  ULList<ULDerivation>& derivationList);
70 
71  void getInflections(const ULString& originalSearchString,
72  ULDerivation& derivation,
73  const ULPartOfSpeech& targetPartOfSpeech,
74  uluint32 maxDerivationLength,
75  ULList<ULDerivation>& derivationList);
76 
77  bool isWordWithPartOfSpeech(const ULString& s, const ULPartOfSpeech& targetPartOfSpeech);
78  void getMatchingTerms(const ULString& s, ULList<ULPartOfSpeech>& pospList, ULList<ULDictionaryIterator>& iteratorList);
79 
80  static void filterRulesForInflection(const ULPartOfSpeech& targetPartOfSpeech, ULList<ULInflectionRule>& ruleList);
81 };
82 
83 #endif
84