ULAPI  8.0
ulfactory.h
1 
7 #ifndef ULFACTORY_H
8 #define ULFACTORY_H
9 
10 #include "ulstring.h"
11 #include "ulerror.h"
12 #include "ullock.h"
13 #include "ulcollator.h"
14 #include "ulstemmer.h"
15 #include "uldefiner.h"
16 #include "ulpartofspeechtagger.h"
17 #include "ulpluralizer.h"
18 #include "ulsingularizer.h"
19 #include "ulconjugator.h"
20 #include "uldictionary.h"
21 #include "ulconfiguration.h"
22 #include "ulnumbertranslator.h"
23 
26 
48 class ULFactory : public ULLockable
49 {
50 public:
51  static ULFactory *createFactory(const ULString& id);
52 
53  ULFactory();
54  virtual ~ULFactory();
55 
61  virtual void clear();
62 
63  void setFactoryID(const ULString& id);
64  const ULString& getFactoryID();
65 
72  virtual void freeInessentialMemory();
73 
88  virtual ULError addLanguageDataSource(const ULString& fileIdentifier, bool loadImmediately=false, ULLanguageDataSource **dataSource=NULL) = 0;
89 
105  virtual ULError addDictionaryDataSource(const ULString& fileIdentifier, bool loadImmediately=false, ULDictionaryDataSource **dataSource=NULL) = 0;
106 
113  virtual ULLock *createLock() = 0;
114 
126  virtual ULError getAvailableLanguages(ULList<ULLanguage>& languageList);
127 
140 
152 
164 
174  virtual ULError getAvailableServices(ULList<ULServiceDescriptor>& serviceList) = 0;
175 
183  virtual ULError getLanguageDataSources(const ULLanguage& language, ULList<ULLanguageDataSource *>& ldsList);
184 
192  virtual ULError getDictionaryDataSources(const ULLanguage& lang1, const ULLanguage& lang2, ULList<ULDictionaryDataSource *>& ddsList);
193 
202 
211 
219  virtual ULCollator *getCollator(const ULLanguage& language) = 0;
220 
232  virtual ULStemmer *getStemmer(ULLanguageDataSource *languageDataSource, ULDictionaryDataSource *dictionaryDataSource) = 0;
233 
249  virtual ULStemmer *getStemmer(const ULLanguage& stemmingLanguage, const ULLanguage& translationLanguage) = 0;
250 
262  virtual ULPartOfSpeechTagger *getPartOfSpeechTagger(ULLanguageDataSource *languageDataSource, ULDictionaryDataSource *dictionaryDataSource) = 0;
263 
279  virtual ULPartOfSpeechTagger *getPartOfSpeechTagger(const ULLanguage& taggingLanguage, const ULLanguage& translationLanguage) = 0;
280 
294  virtual ULPluralizer *getPluralizer(ULLanguageDataSource *languageDataSource, ULDictionaryDataSource *dictionaryDataSource) = 0;
295 
311  virtual ULPluralizer *getPluralizer(const ULLanguage& pluralizerLanguage, const ULLanguage& translationLanguage) = 0;
312 
325  virtual ULSingularizer *getSingularizer(ULLanguageDataSource *languageDataSource, ULDictionaryDataSource *dictionaryDataSource) = 0;
326 
342  virtual ULSingularizer *getSingularizer(const ULLanguage& singularizerLanguage, const ULLanguage& translationLanguage) = 0;
343 
357  virtual ULConjugator *getConjugator(ULLanguageDataSource *languageDataSource, ULDictionaryDataSource *dictionaryDataSource) = 0;
358 
374  virtual ULConjugator *getConjugator(const ULLanguage& conjugationLanguage, const ULLanguage& translationLanguage) = 0;
375 
388  virtual ULDefiner *getDefiner(ULDictionaryDataSource *dictionaryDataSource, ULLanguageDataSource *firstLanguageDataSource, ULLanguageDataSource *secondLanguageDataSource) = 0;
389 
402  virtual ULDefiner *getDefiner(const ULLanguage& language1, const ULLanguage& language2) = 0;
403 
417  virtual ULInflector *getInflector(ULLanguageDataSource *languageDataSource, ULDictionaryDataSource *dictionaryDataSource) = 0;
418 
434  virtual ULInflector *getInflector(const ULLanguage& inflectionLanguage, const ULLanguage& translationLanguage) = 0;
435 
449  virtual ULDissector *getDissector(ULLanguageDataSource *languageDataSource, ULDictionaryDataSource *dictionaryDataSource) = 0;
450 
466  virtual ULDissector *getDissector(const ULLanguage& dissectionLanguage, const ULLanguage& translationLanguage) = 0;
467 
472  virtual ULNumberTranslator *getNumberTranslator(const ULLanguage& language) = 0;
473 
474 protected:
481 
487 
488  ULLanguageDataSource *findLanguageDataSource(const ULString& fileIdentifier);
490 };
491 
492 #endif
493