ULAPI  8.0
uljsondictionarydatasource.h
1 
7 #ifndef ULJSONDICTIONARYDATASOURCE_H
8 #define ULJSONDICTIONARYDATASOURCE_H
9 
10 #include "uldictionary.h"
11 #include "uldictionarydatasource.h"
12 #include "ulpartofspeechcategory.h"
13 #include "ulsegmentedfile.h"
14 #include "json/json.h"
15 
23 {
24  UL_TEST_FRIEND;
26 
27 public:
31 
33 
34  virtual bool operator==(const ULDictionaryDataSource& dataSource) const;
35  virtual bool operator==(const ULJSONDictionaryDataSource& dataSource) const;
36 
37  // ULWorker operations.
38  virtual bool isServiceAvailable(const ULServiceDescriptor& service);
39  virtual void getAvailableServices(ULList<ULServiceDescriptor>& serviceList);
40 
41  // ULDataSource operations.
42  virtual ULError attach(const ULString& dataSourceIdentifier);
43  virtual ULError detach();
44  virtual ULError load();
45  virtual ULError close();
47  virtual ULDataSourceVersion getVersion();
48 
49  // ULDictionary operations.
50  virtual ULError begin(const ULLanguage& searchLanguage,
51  uluint32 indexID,
52  ULDictionaryIterator& iterator);
53 
54  virtual ULError end(const ULLanguage& searchLanguage,
55  uluint32 indexID,
56  ULDictionaryIterator& iterator);
57 
58  virtual ULError find(const ULString& s,
59  const ULLanguage& searchLanguage,
60  uluint32 indexID,
61  ULDictionaryIterator& iterator);
62 
63  // ULDictionaryDataSource operations.
65  virtual const ULLanguage& getFirstLanguage();
66  virtual const ULLanguage& getSecondLanguage();
67  virtual const ULLanguage& getOtherLanguage(const ULLanguage& language);
68  virtual ULForestType getForestType();
69  virtual ULForester *getForester();
70  virtual void setForester(ULForester *newForester);
71  virtual ULError getFeatureNameList(ULList<ULString>& featureNameList);
72  virtual ULError getLocalizationRuleList(const ULLanguage& language, ULList<ULLocalizationRule>& localizationRulesList);
73  virtual bool getULDAttribute(const ULString& key, ULString& value);
74 
75 protected:
77  Json::Value jsonRoot;
78  uluint32 nNodes;
81  ULForester *forester;
83 
84  bool isOpen() const;
85  void clear();
86 };
87 
88 #endif
89