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"
20 #ifdef HAVE_LIBAIKSAURUS
25 Thesaurus::Thesaurus()
30 Thesaurus::~Thesaurus()
36 Thesaurus::Meanings Thesaurus::lookup(string const & text)
40 if (!aik_->find(text.c_str()))
45 int prev_meaning = -1;
49 // correct, returns "" at the end
50 string ret = aik_->next(cur_meaning);
52 while (!ret.empty()) {
53 if (cur_meaning != prev_meaning) {
55 ret = aik_->next(cur_meaning);
56 prev_meaning = cur_meaning;
59 meanings[meaning].push_back(ret);
63 ret = aik_->next(cur_meaning);
66 for (Meanings::iterator it = meanings.begin();
67 it != meanings.end(); ++it) {
68 sort(it->second.begin(), it->second.end());
76 Thesaurus::Thesaurus()
81 Thesaurus::~Thesaurus()
86 Thesaurus::Meanings Thesaurus::lookup(string const &)
91 #endif // HAVE_LIBAIKSAURUS