Nuspell
spellchecker
Public Member Functions | List of all members
nuspell::Dict_Base Struct Reference
Inheritance diagram for nuspell::Dict_Base:
[legend]
Collaboration diagram for nuspell::Dict_Base:
[legend]

Public Member Functions

template<class CharT >
auto spell_priv (std::basic_string< CharT > &s) const -> bool
 Check spelling for a word. More...
 
template<class CharT >
auto spell_break (std::basic_string< CharT > &s, size_t depth=0) const -> bool
 Checks recursively the spelling according to break patterns. More...
 
template<class CharT >
auto spell_casing (std::basic_string< CharT > &s) const -> const Flag_Set *
 Checks spelling according to casing of the provided word. More...
 
template<class CharT >
auto spell_casing_upper (std::basic_string< CharT > &s) const -> const Flag_Set *
 Checks spelling for a word which is in all upper case. More...
 
template<class CharT >
auto spell_casing_title (std::basic_string< CharT > &s) const -> const Flag_Set *
 Checks spelling for a word which is in title casing. More...
 
template<class CharT >
auto spell_sharps (std::basic_string< CharT > &base, size_t n_pos=0, size_t n=0, size_t rep=0) const -> const Flag_Set *
 Checks german word with double SS. More...
 
template<class CharT >
auto check_word (std::basic_string< CharT > &s) const -> const Flag_Set *
 Low-level spell-cheking. More...
 
template<Affixing_Mode m, class CharT >
auto affix_NOT_valid (const Prefix< CharT > &a) const
 
template<Affixing_Mode m, class CharT >
auto affix_NOT_valid (const Suffix< CharT > &a) const
 
template<Affixing_Mode m, class AffixT >
auto outer_affix_NOT_valid (const AffixT &a) const
 
template<class AffixT >
auto is_circumfix (const AffixT &a) const
 
template<Affixing_Mode m>
auto is_valid_inside_compound (const Flag_Set &flags) const
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_prefix_only (std::basic_string< CharT > &s) const -> Affixing_Result< Prefix< CharT >>
 strip_prefix_only More...
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_suffix_only (std::basic_string< CharT > &s) const -> Affixing_Result< Suffix< CharT >>
 strip_suffix_only More...
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_prefix_then_suffix (std::basic_string< CharT > &s) const -> Affixing_Result< Suffix< CharT >, Prefix< CharT >>
 strip_prefix_then_suffix More...
 
template<Affixing_Mode m, class CharT >
auto strip_pfx_then_sfx_2 (const Prefix< CharT > &pe, std::basic_string< CharT > &s) const -> Affixing_Result< Suffix< CharT >, Prefix< CharT >>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_suffix_then_prefix (std::basic_string< CharT > &s) const -> Affixing_Result< Prefix< CharT >, Suffix< CharT >>
 strip_suffix_then_prefix More...
 
template<Affixing_Mode m, class CharT >
auto strip_sfx_then_pfx_2 (const Suffix< CharT > &se, std::basic_string< CharT > &s) const -> Affixing_Result< Prefix< CharT >, Suffix< CharT >>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_prefix_then_suffix_commutative (std::basic_string< CharT > &word) const -> Affixing_Result< Suffix< CharT >, Prefix< CharT >>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_pfx_then_sfx_comm_2 (const Prefix< CharT > &pe, std::basic_string< CharT > &word) const -> Affixing_Result< Suffix< CharT >, Prefix< CharT >>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_suffix_then_suffix (std::basic_string< CharT > &s) const -> Affixing_Result< Suffix< CharT >, Suffix< CharT >>
 
template<Affixing_Mode m, class CharT >
auto strip_sfx_then_sfx_2 (const Suffix< CharT > &se1, std::basic_string< CharT > &s) const -> Affixing_Result< Suffix< CharT >, Suffix< CharT >>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_prefix_then_prefix (std::basic_string< CharT > &s) const -> Affixing_Result< Prefix< CharT >, Prefix< CharT >>
 
template<Affixing_Mode m, class CharT >
auto strip_pfx_then_pfx_2 (const Prefix< CharT > &pe1, std::basic_string< CharT > &s) const -> Affixing_Result< Prefix< CharT >, Prefix< CharT >>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_prefix_then_2_suffixes (std::basic_string< CharT > &s) const -> Affixing_Result<>
 
template<Affixing_Mode m, class CharT >
auto strip_pfx_2_sfx_3 (const Prefix< CharT > &pe1, const Suffix< CharT > &se1, std::basic_string< CharT > &s) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_suffix_prefix_suffix (std::basic_string< CharT > &s) const -> Affixing_Result<>
 
template<Affixing_Mode m, class CharT >
auto strip_s_p_s_3 (const Suffix< CharT > &se1, const Prefix< CharT > &pe1, std::basic_string< CharT > &word) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_2_suffixes_then_prefix (std::basic_string< CharT > &s) const -> Affixing_Result<>
 
template<Affixing_Mode m, class CharT >
auto strip_2_sfx_pfx_3 (const Suffix< CharT > &se1, const Suffix< CharT > &se2, std::basic_string< CharT > &word) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_suffix_then_2_prefixes (std::basic_string< CharT > &s) const -> Affixing_Result<>
 
template<Affixing_Mode m, class CharT >
auto strip_sfx_2_pfx_3 (const Suffix< CharT > &se1, const Prefix< CharT > &pe1, std::basic_string< CharT > &s) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_prefix_suffix_prefix (std::basic_string< CharT > &word) const -> Affixing_Result<>
 
template<Affixing_Mode m, class CharT >
auto strip_p_s_p_3 (const Prefix< CharT > &pe1, const Suffix< CharT > &se1, std::basic_string< CharT > &word) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD, class CharT >
auto strip_2_prefixes_then_suffix (std::basic_string< CharT > &word) const -> Affixing_Result<>
 
template<Affixing_Mode m, class CharT >
auto strip_2_pfx_sfx_3 (const Prefix< CharT > &pe1, const Prefix< CharT > &pe2, std::basic_string< CharT > &word) const -> Affixing_Result<>
 
template<class CharT >
auto check_compound (std::basic_string< CharT > &word) const -> Compounding_Result
 
template<Affixing_Mode m = AT_COMPOUND_BEGIN, class CharT >
auto check_compound (std::basic_string< CharT > &word, size_t start_pos, size_t num_part, std::basic_string< CharT > &part) const -> Compounding_Result
 
template<Affixing_Mode m = AT_COMPOUND_BEGIN, class CharT >
auto check_compound_classic (std::basic_string< CharT > &word, size_t start_pos, size_t i, size_t num_part, std::basic_string< CharT > &part) const -> Compounding_Result
 
template<Affixing_Mode m = AT_COMPOUND_BEGIN, class CharT >
auto check_compound_with_pattern_replacements (std::basic_string< CharT > &word, size_t start_pos, size_t i, size_t num_part, std::basic_string< CharT > &part) const -> Compounding_Result
 
template<class CharT >
auto check_compound_with_rules (std::basic_string< CharT > &word, std::vector< const Flag_Set *> &words_data, size_t start_pos, std::basic_string< CharT > &part) const -> Compounding_Result
 
template<Affixing_Mode m, class CharT >
auto check_word_in_compound (std::basic_string< CharT > &s) const -> Compounding_Result
 
template<class CharT >
auto suggest_priv (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out) const -> void
 
template<class CharT >
auto add_sug_if_correct (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out) const -> bool
 
template<class CharT >
auto try_rep_suggestion (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out) const -> void
 
template<class CharT >
auto rep_suggest (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out) const -> void
 
template<class CharT >
auto extra_char_suggest (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out) const -> void
 
template<class CharT >
auto map_suggest (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out, size_t i=0) const -> void
 
template<class CharT >
auto keyboard_suggest (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out) const -> void
 
template<class CharT >
auto bad_char_suggest (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out) const -> void
 
template<class CharT >
auto forgotten_char_suggest (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out) const -> void
 
template<class CharT >
auto phonetic_suggest (std::basic_string< CharT > &word, List_Basic_Strings< CharT > &out) const -> void
 
- Public Member Functions inherited from nuspell::Aff_Data
auto set_encoding_and_language (const std::string &enc, const std::string &lang="") -> void
 Sets the internal encoding, and optionally, language. More...
 
auto parse_aff (std::istream &in) -> bool
 Parses an input stream offering affix information. More...
 
auto parse_dic (std::istream &in) -> bool
 Parses an input stream offering dictionary information. More...
 
auto parse_aff_dic (std::istream &aff, std::istream &dic)
 
template<class CharT >
auto get_structures () const -> const Aff_Structures< CharT > &
 
template<>
auto get_structures () const -> const Aff_Structures< char > &
 
template<>
auto get_structures () const -> const Aff_Structures< wchar_t > &
 

Additional Inherited Members

- Public Attributes inherited from nuspell::Aff_Data
Word_List words
 
Aff_Structures< char > structures
 
Aff_Structures< wchar_t > wide_structures
 
std::locale internal_locale
 
Flag_Type flag_type
 
bool complex_prefixes
 
bool fullstrip
 
bool checksharps
 
bool forbid_warn
 
char16_t circumfix_flag
 
char16_t forbiddenword_flag
 
char16_t keepcase_flag
 
char16_t need_affix_flag
 
char16_t substandard_flag
 
char16_t warn_flag
 
std::vector< Flag_Setflag_aliases
 
std::string wordchars
 
char16_t nosuggest_flag
 
unsigned short max_compound_suggestions
 
unsigned short max_ngram_suggestions
 
unsigned short max_diff_factor
 
bool only_max_diff
 
bool no_split_suggestions
 
bool suggest_with_dots
 
unsigned short compound_min_length
 
unsigned short compound_max_word_count
 
char16_t compound_flag
 
char16_t compound_begin_flag
 
char16_t compound_last_flag
 
char16_t compound_middle_flag
 
char16_t compound_onlyin_flag
 
char16_t compound_permit_flag
 
char16_t compound_forbid_flag
 
char16_t compound_root_flag
 
char16_t compound_force_uppercase
 
bool compound_more_suffixes
 
bool compound_check_duplicate
 
bool compound_check_rep
 
bool compound_check_case
 
bool compound_check_triple
 
bool compound_simplified_triple
 
Compound_Rule_Table compound_rules
 
unsigned short compound_syllable_max
 
std::string compound_syllable_vowels
 
Flag_Set compound_syllable_num
 

Member Function Documentation

◆ check_word()

template<class CharT >
auto nuspell::Dict_Base::check_word ( std::basic_string< CharT > &  s) const -> const Flag_Set*

Low-level spell-cheking.

Checks spelling for various unaffixed versions of the provided word. Unaffixing is done by combinations of zero or more unsuffixing and unprefixing operations.

Parameters
sstring to check spelling for.
Returns
The flags of the corresponding dictionary word.

◆ spell_break()

template<class CharT >
auto nuspell::Dict_Base::spell_break ( std::basic_string< CharT > &  s,
size_t  depth = 0 
) const -> bool

Checks recursively the spelling according to break patterns.

Parameters
sstring to check spelling for.
Returns
The spelling result.

◆ spell_casing()

template<class CharT >
auto nuspell::Dict_Base::spell_casing ( std::basic_string< CharT > &  s) const -> const Flag_Set*

Checks spelling according to casing of the provided word.

Parameters
sstring to check spelling for.
Returns
The spelling result.

◆ spell_casing_title()

template<class CharT >
auto nuspell::Dict_Base::spell_casing_title ( std::basic_string< CharT > &  s) const -> const Flag_Set*

Checks spelling for a word which is in title casing.

Parameters
sstring to check spelling for.
Returns
The flags of the corresponding dictionary word.

◆ spell_casing_upper()

template<class CharT >
auto nuspell::Dict_Base::spell_casing_upper ( std::basic_string< CharT > &  s) const -> const Flag_Set*

Checks spelling for a word which is in all upper case.

Parameters
sstring to check spelling for.
Returns
The flags of the corresponding dictionary word.

◆ spell_priv()

template<class CharT >
template auto nuspell::Dict_Base::spell_priv ( std::basic_string< CharT > &  s) const -> bool

Check spelling for a word.

Parameters
sstring to check spelling for.
Returns
The spelling result.

◆ spell_sharps()

template<class CharT >
auto nuspell::Dict_Base::spell_sharps ( std::basic_string< CharT > &  base,
size_t  pos = 0,
size_t  n = 0,
size_t  rep = 0 
) const -> const Flag_Set*

Checks german word with double SS.

Checks recursively spelling starting on a word in title or lower case which originate from a word in upper case containing the letters 'SS'. The technique used is use recursion for checking all variations with repetitions of minimal one replacement of 'ss' with sharp s 'ß'. Maximum recursion depth is limited with a hardcoded value.

Parameters
basestring to check spelling for where zero or more occurences of 'ss' have been replaced by sharp s 'ß'.
posposition in the string to start next find and replacement.
ncounter for the recursion depth.
repcounter for the number of replacements done.
Returns
The flags of the corresponding dictionary word.

◆ strip_prefix_only()

template<Affixing_Mode m, class CharT >
auto nuspell::Dict_Base::strip_prefix_only ( std::basic_string< CharT > &  s) const -> Affixing_Result<Prefix<CharT>>

strip_prefix_only

Parameters
sderived word with affixes
Returns
if found, root word + prefix

◆ strip_prefix_then_suffix()

template<Affixing_Mode m, class CharT >
auto nuspell::Dict_Base::strip_prefix_then_suffix ( std::basic_string< CharT > &  s) const -> Affixing_Result<Suffix<CharT>, Prefix<CharT>>

strip_prefix_then_suffix

This accepts a derived word that was formed first by adding suffix then prefix to the root. The stripping is in reverse.

Parameters
sderived word with affixes
Returns
if found, root word + suffix + prefix

◆ strip_suffix_only()

template<Affixing_Mode m, class CharT >
auto nuspell::Dict_Base::strip_suffix_only ( std::basic_string< CharT > &  s) const -> Affixing_Result<Suffix<CharT>>

strip_suffix_only

Parameters
sderived word with affixes
Returns
if found, root word + suffix

◆ strip_suffix_then_prefix()

template<Affixing_Mode m, class CharT >
auto nuspell::Dict_Base::strip_suffix_then_prefix ( std::basic_string< CharT > &  s) const -> Affixing_Result<Prefix<CharT>, Suffix<CharT>>

strip_suffix_then_prefix

This accepts a derived word that was formed first by adding prefix then suffix to the root. The stripping is in reverse.

Parameters
sderived word with prefix and suffix
Returns
if found, root word + prefix + suffix

The documentation for this struct was generated from the following files: