|
crawlserv++
[under development]
Application for crawling and analyzing textual content of websites.
|
RAII wrapper for aspell spell checkers.
More...
#include <AspellChecker.hpp>
Classes | |
| class | Exception |
Class for aspell spell checker-specific exceptions. More... | |
Construction and Destruction | |
| AspellChecker ()=default | |
| Default constructor. More... | |
| virtual | ~AspellChecker () |
| Destructor deleting the spell checker, if necessary. More... | |
Getters | |
| AspellSpeller * | get () |
| Gets a pointer to the underlying spell checker. More... | |
| const AspellSpeller * | getc () const |
| Gets a constant pointer to the underlying spell checker. More... | |
| bool | valid () const |
| Gets whether the spell checker is valid. More... | |
Creation | |
| void | create (AspellConfig &configuration) |
| Creates the spell checker. More... | |
Spell Check | |
| bool | check (const std::string &token, std::vector< std::string > &suggestionsTo) |
| Checks whether a token is correctly spelled. More... | |
Cleanup | |
| void | clear () |
| Deletes the spell checker, if necessary. More... | |
Copy and Move | |
| AspellChecker (AspellChecker &)=delete | |
| Deleted copy constructor. More... | |
| AspellChecker & | operator= (AspellChecker &)=delete |
| Deleted copy assignment operator. More... | |
| AspellChecker (AspellChecker &&other) noexcept | |
| Move constructor. More... | |
| AspellChecker & | operator= (AspellChecker &&other) noexcept |
| Move assignment operator. More... | |
RAII wrapper for aspell spell checkers.
Creates the spell checker on construction and deletes it on destruction, if still necessary, avoiding memory leaks.
|
default |
Default constructor.
|
inlinevirtual |
|
delete |
Deleted copy constructor.
|
inlinenoexcept |
Move constructor.
Moves the spell checker from the specified location into this instance of the class.
| other | The spell checker to move from. |
|
inline |
Checks whether a token is correctly spelled.
| token | Constant reference to a string containing the token to be checked. |
| suggestionsTo | Reference to a vector to which correction suggestions for the token will be appended, if the token is not correctly spelled, according to aspell. |
aspell and the language set in the current configuration. Returns false otherwise.| AspellChecker::Exception | if the spell checker is not valid, or an error occured while checking the token. |
References crawlservpp::Wrapper::AspellList::next().
Referenced by crawlservpp::Data::TokenCorrect::correct().
|
inline |
Deletes the spell checker, if necessary.
Referenced by create(), operator=(), and ~AspellChecker().
|
inline |
Creates the spell checker.
Delets the old one, if necessary.
| configuration | The aspell configuration used by the aspell spell checker. |
| AspellChecker::Exception | if the configuration is not valid, or the spell checker could not be created. |
References clear(), crawlservpp::Wrapper::AspellConfig::get(), and crawlservpp::Wrapper::AspellConfig::valid().
Referenced by crawlservpp::Data::TokenCorrect::TokenCorrect().
|
inline |
|
inline |
|
delete |
Deleted copy assignment operator.
|
inlinenoexcept |
Move assignment operator.
Moves the spell checker from the specified location into this instance of the class.
| other | The spell checker to move from. |
*this).References clear().
|
inline |
Gets whether the spell checker is valid.