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

Public Member Functions

auto spell_priv (std::wstring &s) const -> bool
 Check spelling for a word. More...
 
auto spell_break (std::wstring &s, size_t depth=0) const -> bool
 Checks recursively the spelling according to break patterns. More...
 
auto spell_casing (std::wstring &s) const -> const Flag_Set *
 Checks spelling according to casing of the provided word. More...
 
auto spell_casing_upper (std::wstring &s) const -> const Flag_Set *
 Checks spelling for a word which is in all upper case. More...
 
auto spell_casing_title (std::wstring &s) const -> const Flag_Set *
 Checks spelling for a word which is in title casing. More...
 
auto spell_sharps (std::wstring &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...
 
auto check_word (std::wstring &s, Casing input_word_casing) const -> const Flag_Set *
 Low-level spell-cheking. More...
 
auto check_simple_word (std::wstring &word) const -> const Flag_Set *
 
template<Affixing_Mode m>
auto affix_NOT_valid (const Prefix< wchar_t > &a) const
 
template<Affixing_Mode m>
auto affix_NOT_valid (const Suffix< wchar_t > &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>
auto strip_prefix_only (std::wstring &s) const -> Affixing_Result< Prefix< wchar_t >>
 strip_prefix_only More...
 
template<Affixing_Mode m = FULL_WORD>
auto strip_suffix_only (std::wstring &s) const -> Affixing_Result< Suffix< wchar_t >>
 strip_suffix_only More...
 
template<Affixing_Mode m = FULL_WORD>
auto strip_prefix_then_suffix (std::wstring &s) const -> Affixing_Result< Suffix< wchar_t >, Prefix< wchar_t >>
 strip_prefix_then_suffix More...
 
template<Affixing_Mode m>
auto strip_pfx_then_sfx_2 (const Prefix< wchar_t > &pe, std::wstring &s) const -> Affixing_Result< Suffix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_suffix_then_prefix (std::wstring &s) const -> Affixing_Result< Prefix< wchar_t >, Suffix< wchar_t >>
 strip_suffix_then_prefix More...
 
template<Affixing_Mode m>
auto strip_sfx_then_pfx_2 (const Suffix< wchar_t > &se, std::wstring &s) const -> Affixing_Result< Prefix< wchar_t >, Suffix< wchar_t >>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_prefix_then_suffix_commutative (std::wstring &word) const -> Affixing_Result< Suffix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_pfx_then_sfx_comm_2 (const Prefix< wchar_t > &pe, std::wstring &word) const -> Affixing_Result< Suffix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_suffix_then_suffix (std::wstring &s) const -> Affixing_Result< Suffix< wchar_t >, Suffix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_sfx_then_sfx_2 (const Suffix< wchar_t > &se1, std::wstring &s) const -> Affixing_Result< Suffix< wchar_t >, Suffix< wchar_t >>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_prefix_then_prefix (std::wstring &s) const -> Affixing_Result< Prefix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_pfx_then_pfx_2 (const Prefix< wchar_t > &pe1, std::wstring &s) const -> Affixing_Result< Prefix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_prefix_then_2_suffixes (std::wstring &s) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_pfx_2_sfx_3 (const Prefix< wchar_t > &pe1, const Suffix< wchar_t > &se1, std::wstring &s) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_suffix_prefix_suffix (std::wstring &s) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_s_p_s_3 (const Suffix< wchar_t > &se1, const Prefix< wchar_t > &pe1, std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_2_suffixes_then_prefix (std::wstring &s) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_2_sfx_pfx_3 (const Suffix< wchar_t > &se1, const Suffix< wchar_t > &se2, std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_suffix_then_2_prefixes (std::wstring &s) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_sfx_2_pfx_3 (const Suffix< wchar_t > &se1, const Prefix< wchar_t > &pe1, std::wstring &s) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_prefix_suffix_prefix (std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_p_s_p_3 (const Prefix< wchar_t > &pe1, const Suffix< wchar_t > &se1, std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m = FULL_WORD>
auto strip_2_prefixes_then_suffix (std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_2_pfx_sfx_3 (const Prefix< wchar_t > &pe1, const Prefix< wchar_t > &pe2, std::wstring &word) const -> Affixing_Result<>
 
auto check_compound (std::wstring &word, Casing input_word_casing) const -> Compounding_Result
 
template<Affixing_Mode m = AT_COMPOUND_BEGIN>
auto check_compound (std::wstring &word, size_t start_pos, size_t num_part, std::wstring &part, Casing input_word_casing) const -> Compounding_Result
 
template<Affixing_Mode m = AT_COMPOUND_BEGIN>
auto check_compound_classic (std::wstring &word, size_t start_pos, size_t i, size_t num_part, std::wstring &part, Casing input_word_casing) const -> Compounding_Result
 
template<Affixing_Mode m = AT_COMPOUND_BEGIN>
auto check_compound_with_pattern_replacements (std::wstring &word, size_t start_pos, size_t i, size_t num_part, std::wstring &part, Casing input_word_casing) const -> Compounding_Result
 
template<Affixing_Mode m>
auto check_word_in_compound (std::wstring &s) const -> Compounding_Result
 
auto calc_num_words_modifier (const Prefix< wchar_t > &pfx) const -> unsigned char
 
template<Affixing_Mode m>
auto calc_syllable_modifier (Word_List::const_reference we) const -> signed char
 
template<Affixing_Mode m>
auto calc_syllable_modifier (Word_List::const_reference we, const Suffix< wchar_t > &sfx) const -> signed char
 
auto count_syllables (const std::wstring &word) const -> size_t
 
auto check_compound_with_rules (std::wstring &word, std::vector< const Flag_Set *> &words_data, size_t start_pos, std::wstring &part, Casing input_word_casing) const -> Compounding_Result
 
auto suggest_priv (std::wstring &word, List_WStrings &out) const -> void
 
auto add_sug_if_correct (std::wstring &word, List_WStrings &out) const -> bool
 
auto uppercase_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto rep_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto try_rep_suggestion (std::wstring &word, List_WStrings &out) const -> void
 
auto is_rep_similar (std::wstring &word) const -> bool
 
auto map_suggest (std::wstring &word, List_WStrings &out, size_t i=0) const -> void
 
auto adjacent_swap_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto distant_swap_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto keyboard_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto extra_char_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto forgotten_char_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto move_char_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto bad_char_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto doubled_two_chars_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto two_words_suggest (std::wstring &word, List_WStrings &out) const -> void
 
auto phonetic_suggest (std::wstring &word, List_WStrings &out) const -> void
 
template<Affixing_Mode m>
auto affix_NOT_valid (const Prefix< wchar_t > &e) const
 
template<Affixing_Mode m>
auto affix_NOT_valid (const Suffix< wchar_t > &e) const
 
template<Affixing_Mode m, class AffixT >
auto outer_affix_NOT_valid (const AffixT &e) 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>
auto strip_prefix_only (std::wstring &word) const -> Affixing_Result< Prefix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_suffix_only (std::wstring &word) const -> Affixing_Result< Suffix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_prefix_then_suffix (std::wstring &word) const -> Affixing_Result< Suffix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_pfx_then_sfx_2 (const Prefix< wchar_t > &pe, std::wstring &word) const -> Affixing_Result< Suffix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_suffix_then_prefix (std::wstring &word) const -> Affixing_Result< Prefix< wchar_t >, Suffix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_sfx_then_pfx_2 (const Suffix< wchar_t > &se, std::wstring &word) const -> Affixing_Result< Prefix< wchar_t >, Suffix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_prefix_then_suffix_commutative (std::wstring &word) const -> Affixing_Result< Suffix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_pfx_then_sfx_comm_2 (const Prefix< wchar_t > &pe, std::wstring &word) const -> Affixing_Result< Suffix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_suffix_then_suffix (std::wstring &word) const -> Affixing_Result< Suffix< wchar_t >, Suffix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_sfx_then_sfx_2 (const Suffix< wchar_t > &se1, std::wstring &word) const -> Affixing_Result< Suffix< wchar_t >, Suffix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_prefix_then_prefix (std::wstring &word) const -> Affixing_Result< Prefix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_pfx_then_pfx_2 (const Prefix< wchar_t > &pe1, std::wstring &word) const -> Affixing_Result< Prefix< wchar_t >, Prefix< wchar_t >>
 
template<Affixing_Mode m>
auto strip_prefix_then_2_suffixes (std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_pfx_2_sfx_3 (const Prefix< wchar_t > &pe1, const Suffix< wchar_t > &se1, std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_suffix_prefix_suffix (std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_s_p_s_3 (const Suffix< wchar_t > &se1, const Prefix< wchar_t > &pe1, std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_2_suffixes_then_prefix (std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_2_sfx_pfx_3 (const Suffix< wchar_t > &se1, const Suffix< wchar_t > &se2, std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_suffix_then_2_prefixes (std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_sfx_2_pfx_3 (const Suffix< wchar_t > &se1, const Prefix< wchar_t > &pe1, std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_prefix_suffix_prefix (std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_p_s_p_3 (const Prefix< wchar_t > &pe1, const Suffix< wchar_t > &se1, std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_2_prefixes_then_suffix (std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto strip_2_pfx_sfx_3 (const Prefix< wchar_t > &pe1, const Prefix< wchar_t > &pe2, std::wstring &word) const -> Affixing_Result<>
 
template<Affixing_Mode m>
auto check_compound (std::wstring &word, size_t start_pos, size_t num_part, std::wstring &part, Casing input_word_casing) const -> Compounding_Result
 
template<Affixing_Mode m>
auto check_compound_classic (std::wstring &word, size_t start_pos, size_t i, size_t num_part, std::wstring &part, Casing input_word_casing) const -> Compounding_Result
 
template<Affixing_Mode m>
auto check_compound_with_pattern_replacements (std::wstring &word, size_t start_pos, size_t i, size_t num_part, std::wstring &part, Casing input_word_casing) const -> Compounding_Result
 
template<Affixing_Mode m>
auto check_word_in_compound (std::wstring &word) const -> Compounding_Result
 
template<Affixing_Mode m>
auto calc_syllable_modifier (Word_List::const_reference we) const -> signed char
 
template<Affixing_Mode m>
auto calc_syllable_modifier (Word_List::const_reference we, const Suffix< wchar_t > &sfx) const -> signed char
 
- Public Member Functions inherited from nuspell::v3::Aff_Data
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)
 

Additional Inherited Members

- Public Attributes inherited from nuspell::v3::Aff_Data
Word_List words
 
Prefix_Table prefixes
 
Suffix_Table suffixes
 
bool complex_prefixes
 
bool fullstrip
 
bool checksharps
 
bool forbid_warn
 
char16_t compound_onlyin_flag
 
char16_t circumfix_flag
 
char16_t forbiddenword_flag
 
char16_t keepcase_flag
 
char16_t need_affix_flag
 
char16_t warn_flag
 
char16_t compound_flag
 
char16_t compound_begin_flag
 
char16_t compound_last_flag
 
char16_t compound_middle_flag
 
Compound_Rule_Table compound_rules
 
Break_Table< wchar_t > break_table
 
Substr_Replacer< wchar_t > input_substr_replacer
 
std::wstring ignored_chars
 
icu::Locale icu_locale
 
Substr_Replacer< wchar_t > output_substr_replacer
 
Replacement_Table< wchar_t > replacements
 
std::vector< Similarity_Group< wchar_t > > similarities
 
std::wstring keyboard_closeness
 
std::wstring try_chars
 
Phonetic_Table< wchar_t > phonetic_table
 
char16_t nosuggest_flag
 
char16_t substandard_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_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
 
bool compound_syllable_num
 
unsigned short compound_syllable_max
 
std::wstring compound_syllable_vowels
 
std::vector< Compound_Pattern< wchar_t > > compound_patterns
 
Flag_Type flag_type
 
Encoding encoding
 
std::vector< Flag_Setflag_aliases
 
std::string wordchars
 

Member Function Documentation

◆ check_word()

auto nuspell::Dict_Base::check_word ( std::wstring &  s,
Casing  input_word_casing 
) 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()

auto nuspell::Dict_Base::spell_break ( std::wstring &  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()

auto nuspell::Dict_Base::spell_casing ( std::wstring &  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()

auto nuspell::Dict_Base::spell_casing_title ( std::wstring &  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()

auto nuspell::Dict_Base::spell_casing_upper ( std::wstring &  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()

auto nuspell::Dict_Base::spell_priv ( std::wstring &  s) const -> bool

Check spelling for a word.

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

◆ spell_sharps()

auto nuspell::Dict_Base::spell_sharps ( std::wstring &  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 = FULL_WORD>
auto nuspell::v3::Dict_Base::strip_prefix_only ( std::wstring &  s) const -> Affixing_Result< Prefix< wchar_t >>

strip_prefix_only

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

◆ strip_prefix_then_suffix()

template<Affixing_Mode m = FULL_WORD>
auto nuspell::v3::Dict_Base::strip_prefix_then_suffix ( std::wstring &  s) const -> Affixing_Result< Suffix< wchar_t >, Prefix< wchar_t >>

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 = FULL_WORD>
auto nuspell::v3::Dict_Base::strip_suffix_only ( std::wstring &  s) const -> Affixing_Result< Suffix< wchar_t >>

strip_suffix_only

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

◆ strip_suffix_then_prefix()

template<Affixing_Mode m = FULL_WORD>
auto nuspell::v3::Dict_Base::strip_suffix_then_prefix ( std::wstring &  s) const -> Affixing_Result< Prefix< wchar_t >, Suffix< wchar_t >>

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: