24#ifndef NUSPELL_DICTIONARY_HXX
25#define NUSPELL_DICTIONARY_HXX
27#include "suggester.hxx"
32NUSPELL_BEGIN_INLINE_NAMESPACE
39 using std::runtime_error::runtime_error;
45class NUSPELL_EXPORT Dictionary :
private Suggester {
46 [[deprecated]] Dictionary(std::istream& aff, std::istream& dic);
50 auto load_aff_dic(std::istream& aff, std::istream& dic) -> void;
51 auto load_aff_dic(
const std::filesystem::path& aff_path) -> void;
57 auto load_aff_dic_internal(
const std::filesystem::path& aff_path,
58 std::ostream& err_msg) -> void;
64 const std::string& file_path_without_extension) -> Dictionary;
65 auto spell(std::string_view word)
const -> bool;
66 auto suggest(std::string_view word, std::vector<std::string>& out)
const
70NUSPELL_END_INLINE_NAMESPACE
The only important public exception.
Definition dictionary.hxx:37
auto load_aff_dic(std::istream &aff, std::istream &dic) -> void
Load the dictionary from opened files as iostreams.
Definition dictionary.cxx:45
auto spell(std::string_view word) const -> bool
Checks if a given word is correct.
Definition dictionary.cxx:135
static auto load_from_path(const std::string &file_path_without_extension) -> Dictionary
Create a dictionary from files.
Definition dictionary.cxx:122
auto suggest(std::string_view word, std::vector< std::string > &out) const -> void
Suggests correct words for a given incorrect word.
Definition dictionary.cxx:151
static auto load_from_aff_dic(std::istream &aff, std::istream &dic) -> Dictionary
Create a dictionary from opened files as iostreams.
Definition dictionary.cxx:104
Library main namespace.
Definition aff_data.cxx:33
Definition suggester.hxx:27