2012-10-30 16:59:47 +01:00
|
|
|
// Copyright (c) 2012, Thomas Goyne <plorkyeran@aegisub.org>
|
2006-12-25 22:56:56 +01:00
|
|
|
//
|
2012-10-30 16:59:47 +01:00
|
|
|
// Permission to use, copy, modify, and distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice appear in all copies.
|
2006-12-25 22:56:56 +01:00
|
|
|
//
|
2012-10-30 16:59:47 +01:00
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2006-12-25 22:56:56 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
|
|
|
|
|
|
|
/// @file thesaurus.h
|
|
|
|
/// @see thesaurus.cpp
|
|
|
|
/// @ingroup thesaurus
|
|
|
|
///
|
2006-12-25 22:56:56 +01:00
|
|
|
|
2013-01-04 16:01:50 +01:00
|
|
|
#include <memory>
|
2012-10-30 16:59:47 +01:00
|
|
|
#include <string>
|
2006-12-25 23:21:44 +01:00
|
|
|
#include <vector>
|
|
|
|
|
2012-01-08 02:36:50 +01:00
|
|
|
#include <libaegisub/signal.h>
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2012-01-08 02:36:50 +01:00
|
|
|
namespace agi { class Thesaurus; }
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @class Thesaurus
|
2012-01-08 02:36:50 +01:00
|
|
|
/// @brief A wrapper around agi::Thesarus adding wx and Aegisub-specific stuff
|
2006-12-25 22:56:56 +01:00
|
|
|
class Thesaurus {
|
2013-01-04 16:01:50 +01:00
|
|
|
/// The actual thesaurus implementation
|
|
|
|
std::unique_ptr<agi::Thesaurus> impl;
|
2012-01-08 02:36:50 +01:00
|
|
|
/// A cached list of languages available
|
2012-10-30 16:59:47 +01:00
|
|
|
mutable std::vector<std::string> languages;
|
2012-01-08 02:36:50 +01:00
|
|
|
|
|
|
|
/// Thesaurus language change slot
|
|
|
|
agi::signal::Connection lang_listener;
|
|
|
|
/// Thesaurus language change handler
|
|
|
|
void OnLanguageChanged();
|
|
|
|
|
|
|
|
/// Thesaurus path change slot
|
|
|
|
agi::signal::Connection dict_path_listener;
|
|
|
|
/// Thesaurus path change handler
|
|
|
|
void OnPathChanged();
|
2006-12-25 22:56:56 +01:00
|
|
|
public:
|
2012-01-08 02:36:50 +01:00
|
|
|
/// A pair of a word and synonyms for that word
|
2012-12-11 19:58:28 +01:00
|
|
|
typedef std::pair<std::string, std::vector<std::string>> Entry;
|
2006-12-25 22:56:56 +01:00
|
|
|
|
2012-01-08 02:36:50 +01:00
|
|
|
Thesaurus();
|
|
|
|
~Thesaurus();
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2012-01-08 02:36:50 +01:00
|
|
|
/// Get a list of synonyms for a word, grouped by possible meanings of the word
|
|
|
|
/// @param word Word to get synonyms for
|
2013-11-02 15:52:45 +01:00
|
|
|
std::vector<Entry> Lookup(std::string word);
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2012-01-08 02:36:50 +01:00
|
|
|
/// Get a list of language codes which thesauri are available for
|
2012-10-30 16:59:47 +01:00
|
|
|
std::vector<std::string> GetLanguageList() const;
|
2006-12-25 22:56:56 +01:00
|
|
|
};
|