3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "Thesaurus.h"
15 #ifdef HAVE_LIBAIKSAURUS
22 Thesaurus::Thesaurus()
28 Thesaurus::~Thesaurus()
34 Thesaurus::Meanings Thesaurus::lookup(string const & text)
38 if (!aik_->find(text.c_str()))
43 int prev_meaning = -1;
47 // correct, returns "" at the end
48 string ret = aik_->next(cur_meaning);
50 while (!ret.empty()) {
51 if (cur_meaning != prev_meaning) {
53 ret = aik_->next(cur_meaning);
54 prev_meaning = cur_meaning;
57 meanings[meaning].push_back(ret);
61 ret = aik_->next(cur_meaning);
64 for (Meanings::iterator it = meanings.begin();
65 it != meanings.end(); ++it) {
66 sort(it->second.begin(), it->second.end());
74 Thesaurus::Thesaurus()
79 Thesaurus::~Thesaurus()
84 Thesaurus::Meanings Thesaurus::lookup(string const &)
89 #endif // HAVE_LIBAIKSAURUS