]> git.lyx.org Git - lyx.git/blob - src/Thesaurus.h
Fix working of the spellchecker dialog with ispell when there are no
[lyx.git] / src / Thesaurus.h
1 // -*- C++ -*-
2 /**
3  * \file Thesaurus.h
4  * Copyright 2001 the LyX Team
5  * Read the file COPYING
6  *
7  * \author John Levon
8  */
9
10 #ifndef THESAURUS_H
11 #define THESAURUS_H
12  
13 #include <vector>
14
15 #include <config.h>
16  
17 #include "LString.h"
18 #ifdef HAVE_LIBAIKSAURUS
19 #include "AikSaurus.h"
20 #endif
21  
22 /**
23  * This class provides an interface to whatever thesauri we might support.
24  */
25
26 class Thesaurus {
27 public:
28         ///
29         Thesaurus();
30         ///
31         ~Thesaurus();
32
33         /**
34          * enum of possible part of speech types
35          */
36         enum POS {
37                 NONE = 0x0,
38                 OTHER = 0x01,
39                 NOUN = 0x02,
40                 VERB = 0x04,
41                 ADJECTIVE = 0x08,
42                 ADVERB = 0x10
43         };
44
45         /**
46          * an individual entry from the thesaurus 
47          */
48         struct ThesaurusEntry {
49                 /// 
50                 ThesaurusEntry(const string & ent, char pos); 
51                 /// the actual entry 
52                 string entry;
53                 /// entry's part of speech
54                 int pos;
55         };
56
57         /**
58          * look up some text in the thesaurus
59          */
60         std::vector<ThesaurusEntry> lookup(string const & text);
61
62 private:
63 #ifdef HAVE_LIBAIKSAURUS
64         AikSaurus * aik_;
65 #endif
66 };
67  
68 extern Thesaurus thesaurus;
69  
70 #endif