00001 #ifndef __DwdsThesaurus_H_ 00002 #define __DwdsThesaurus_H_ 00003 00004 #include "../common/util_classes.h" 00005 00006 00007 class CDwdsThesaurus 00008 { 00009 // all possible supernodes of the thesaurus Adel, H... 00010 StringVector HyperTerms; 00011 // a buffer to store pathes from the leaf to the root 00012 vector<DWORD> Pathes; 00013 00014 // an index which points to vector Pathes 00015 // the count of PathEndIndex is equal to the count of leaves in the thesaurus 00016 // Pathes[ PathEndIndex[i-1].... PathEndIndex[i] ] is a path number i 00017 vector<DWORD> PathEndIndex; 00018 00019 // an index which points to vector Pathes 00020 vector<DWORD> LeavesPathes; 00021 CShortStringHolder LeavesLemmas; 00022 00023 DwordVector m_AllPathes; 00024 00025 public: 00026 bool LoadDwdsThesaurus (); 00027 int FindHyperTerm (const string& s) const; 00028 void GetAllPathesWhichContainHyperTermNo (size_t HyperTermNo, DwordVector& sub_pathes) const; 00029 bool ReadPathFromString(const string& TextPath, vector<int>& HyperTermNos) const; 00030 void GetAllPathesWhichStartFromThisSequence (const vector<int>& HyperTermNos, DwordVector& Result) const; 00031 void GetAllLemmasWhosePathesStartFromThisSequence (const vector<int>& HyperTermNos, StringSet& Lemmas) const; 00032 string GetAllThesInterpetations(const char* Lemma) const; 00033 }; 00034 00035 extern const CDwdsThesaurus* LoadDwdsThesaurus(); 00036 extern void FreeDwdsThesaurus(const CDwdsThesaurus*); 00037 00038 #endif