ULAPI  8.0
ulpartofspeechtagger.h
1 
7 #ifndef ULPARTOFSPEECHTAGGER_H
8 #define ULPARTOFSPEECHTAGGER_H
9 
10 #include "ulworker.h"
11 #include "uldissector.h"
12 
28 {
29 public:
30  friend class ULPartOfSpeechTagger;
31 
32  ULTaggedWord();
33  ULTaggedWord(const ULTaggedWord& other);
34  virtual ~ULTaggedWord();
35 
36  void operator=(const ULTaggedWord& other);
37  bool operator==(const ULTaggedWord& other) const;
38  bool operator<(const ULTaggedWord& other) const;
39 
40  const ULString& getSurfaceForm() const;
41  const ULList<ULDerivation>& getTagList() const;
42 
43 private:
44  ULString surfaceForm;
46  bool ordered;
47 };
48 
57 {
58 public:
61  virtual ~ULPartOfSpeechTagger();
62 
64  void clear();
65 
66  // Accessors.
67  const ULLanguage& getLanguage() const;
68  void setDissector(ULDissector *newDissector);
70 
71  // ULWorker interfaces.
72  virtual bool isServiceAvailable(const ULServiceDescriptor& service);
73  virtual void getAvailableServices(ULList<ULServiceDescriptor>& services);
74 
75  // The tagger's core services.
76  ULError getTags(const ULString& sentence, ULList<ULTaggedWord>& taggedWords);
77  ULError getTags(const ULString& sentence, ULList<ULDerivation>& words);
78 
79 private:
80  ULDissector *dissector;
81 
82  void tokenize(const ULString& s, ULList<ULString>& tokenList);
83  bool resolveAmbiguityWithRule(const ULTaggingRule& rule,
84  ULList<ULTaggedWord>& taggedWords,
85  uluint32& nAmbiguities);
86  bool dissectionListHasMatchingCategory(const ULList<ULDerivation>& wordList,
87  const ULPartOfSpeechCategory& category);
88 };
89 
90 #endif
91