ULAPI  8.0
ulpluralizer.h
1 
7 #ifndef ULPLURALIZER_H
8 #define ULPLURALIZER_H
9 
10 #include "ulworker.h"
11 #include "ulinflector.h"
12 #include "uldissector.h"
13 
18 class ULPluralizer : public ULWorker
19 {
20 public:
21  ULPluralizer();
22  ULPluralizer(const ULPluralizer& other);
23  virtual ~ULPluralizer();
24 
25  ULPluralizer& operator=(const ULPluralizer& other);
26  void clear();
27 
28  // Accessors
30  void setInflector(ULInflector *newInflector);
32  void setDissector(ULDissector *newDissector);
33  const ULLanguage& getLanguage() const;
34 
35  // ULWorker interfaces.
36  virtual bool isServiceAvailable(const ULServiceDescriptor& service);
37  virtual void getAvailableServices(ULList<ULServiceDescriptor>& services);
38 
39  // The core services provided by the pluralizer.
40  ULError getPlural(const ULString& word, ULString& plural);
41  ULError getAllPlurals(const ULString& word, ULList<ULString>& pluralList);
42  ULError getPluralFromSingular(const ULString& singular, ULString& plural);
43  ULError getAllPluralsFromSingular(const ULString& singular, ULList<ULString>& pluralList);
44 
45 private:
46  ULInflector *inflector;
47  ULDissector *dissector;
48 
49  void getPluralNouns(const ULDerivation& singularNoun, ULList<ULString>& pluralList);
50 };
51 
52 #endif