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"
|
|
|
|
|
2002-01-13 01:46:33 +00:00
|
|
|
#include <map>
|
2008-11-16 18:48:25 +00:00
|
|
|
#include <string>
|
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
|
|
|
|
{
|
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
|
|
|
|
*/
|
2008-11-16 18:48:25 +00:00
|
|
|
Meanings lookup(docstring const & text, docstring const & lang);
|
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
|