2001-08-02 18:46:53 +00:00
|
|
|
// -*- C++ -*-
|
2001-07-29 10:42:11 +00:00
|
|
|
/**
|
|
|
|
* \file Thesaurus.h
|
2003-08-23 00:17:00 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-07-29 10:42:11 +00:00
|
|
|
*
|
|
|
|
* \author John Levon
|
2008-11-16 18:48:25 +00:00
|
|
|
* \author Jürgen Spitzmüller
|
2003-08-23 00:17:00 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-07-29 10:42:11 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef THESAURUS_H
|
|
|
|
#define THESAURUS_H
|
2002-03-21 17:27:08 +00:00
|
|
|
|
2006-12-10 11:52:46 +00:00
|
|
|
#include "support/docstring.h"
|
2012-03-02 10:20:09 +00:00
|
|
|
#include "WordLangTuple.h"
|
2006-12-10 11:52:46 +00:00
|
|
|
|
2002-01-13 01:46:33 +00:00
|
|
|
#include <map>
|
2009-05-01 06:33:19 +00:00
|
|
|
#include <vector>
|
2002-03-21 17:27:08 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2001-07-29 10:42:11 +00:00
|
|
|
/**
|
|
|
|
* This class provides an interface to whatever thesauri we might support.
|
|
|
|
*/
|
|
|
|
|
2008-11-16 19:22:06 +00:00
|
|
|
class Thesaurus
|
|
|
|
{
|
2015-09-20 17:43:06 +00:00
|
|
|
/// noncopyable
|
|
|
|
Thesaurus(Thesaurus const &);
|
|
|
|
void operator=(Thesaurus const &);
|
2001-07-29 10:42:11 +00:00
|
|
|
public:
|
|
|
|
///
|
|
|
|
Thesaurus();
|
|
|
|
///
|
|
|
|
~Thesaurus();
|
|
|
|
|
2006-12-10 11:52:46 +00:00
|
|
|
typedef std::map<docstring, std::vector<docstring> > Meanings;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
2001-07-29 10:42:11 +00:00
|
|
|
/**
|
|
|
|
* look up some text in the thesaurus
|
|
|
|
*/
|
2012-03-02 10:20:09 +00:00
|
|
|
Meanings lookup(WordLangTuple const & wl);
|
2010-02-10 08:10:31 +00:00
|
|
|
/** check if a thesaurus for a given language \p lang is available
|
|
|
|
* (installed and loaded)
|
|
|
|
*/
|
2008-11-16 18:48:25 +00:00
|
|
|
bool thesaurusAvailable(docstring const & lang) const;
|
2010-02-10 08:10:31 +00:00
|
|
|
/// check if a thesaurus for a given language \p lang is installed
|
|
|
|
bool thesaurusInstalled(docstring const & lang) const;
|
2001-07-29 10:42:11 +00:00
|
|
|
|
|
|
|
private:
|
2009-05-01 06:33:19 +00:00
|
|
|
struct Private;
|
|
|
|
Private * const d;
|
2001-07-29 10:42:11 +00:00
|
|
|
};
|
2002-03-21 17:27:08 +00:00
|
|
|
|
2001-07-29 10:42:11 +00:00
|
|
|
extern Thesaurus thesaurus;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2001-07-29 10:42:11 +00:00
|
|
|
#endif
|