| 1 |
/* |
| 2 |
* Aiksaurus - An open source thesaurus library |
| 3 |
* Copyright (C) 2001 by Jared Davis |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU General Public License |
| 7 |
* as published by the Free Software Foundation; either version 2 |
| 8 |
* of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 18 |
* 02111-1307, USA. |
| 19 |
* |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef INCLUDED_AIKSAURUS_H |
| 23 |
#define INCLUDED_AIKSAURUS_H |
| 24 |
|
| 25 |
namespace AiksaurusImpl |
| 26 |
{ |
| 27 |
class ThesaurusImpl; |
| 28 |
|
| 29 |
class Aiksaurus |
| 30 |
{ |
| 31 |
private: |
| 32 |
ThesaurusImpl *d_impl_ptr; |
| 33 |
|
| 34 |
// prevent copying or assignment, since this is |
| 35 |
// a large object to create and destroy. |
| 36 |
Aiksaurus(const Aiksaurus& rhs); |
| 37 |
const Aiksaurus& operator=(const Aiksaurus& rhs); |
| 38 |
|
| 39 |
public: |
| 40 |
Aiksaurus(); |
| 41 |
~Aiksaurus(); |
| 42 |
|
| 43 |
// call 'word' to figure out what word is current. |
| 44 |
const char* word() const; |
| 45 |
|
| 46 |
// call 'find' to set up which word you want |
| 47 |
// the results from. Returns true if the word is |
| 48 |
// found, false otherwise. |
| 49 |
bool find(const char* word); |
| 50 |
|
| 51 |
// call 'next' repeatedly to return one synonym |
| 52 |
// at a time, until it returns empty string. |
| 53 |
// you should not delete the string: the next |
| 54 |
// call to 'next' will overwrite the string. |
| 55 |
// 'meaning' is an integer indicating which |
| 56 |
// meaning this synonym belongs to. |
| 57 |
const char* next(int& meaning); |
| 58 |
|
| 59 |
// call 'label' to return the label for a |
| 60 |
// meaning id. NOT IMPLEMENTED YET. |
| 61 |
// at present, this will just return |
| 62 |
// 'null'. |
| 63 |
const char* label(int meaning); |
| 64 |
|
| 65 |
// call 'similar' repeatdly to return one |
| 66 |
// "nearby word" at a time. these are not |
| 67 |
// synonyms: they are known words that are |
| 68 |
// alphabetically near the searched-for word. |
| 69 |
const char* similar(); |
| 70 |
|
| 71 |
// call 'error' to find out if something went |
| 72 |
// wrong. will be empty if no problems. you |
| 73 |
// do not have to delete this string, it is |
| 74 |
// managed automatically. |
| 75 |
const char* error(); |
| 76 |
}; |
| 77 |
} |
| 78 |
|
| 79 |
typedef AiksaurusImpl::Aiksaurus Aiksaurus; |
| 80 |
|
| 81 |
#endif // INCLUDED_AIKSAURUS_H |