34 NUSPELL_EXPORT
auto normalize_name() -> void;
37 enum Enc_Type { SINGLEBYTE =
false, UTF8 =
true };
40 explicit Encoding(
const std::string& e) : name(e) { normalize_name(); }
41 explicit Encoding(std::string&& e) : name(std::move(e))
45 explicit Encoding(
const char* e) : name(e) { normalize_name(); }
46 auto& operator=(
const std::string& e)
52 auto& operator=(std::string&& e)
58 auto& operator=(
const char* e)
64 auto empty()
const {
return name.empty(); }
65 auto& value()
const {
return name; }
66 auto is_utf8()
const {
return name ==
"UTF-8"; }
67 auto value_or_default()
const -> std::string
74 operator Enc_Type()
const {
return is_utf8() ? UTF8 : SINGLEBYTE; }
77enum class Flag_Type { SINGLE_CHAR, DOUBLE_CHAR, NUMBER, UTF8 };
92 static constexpr char16_t HIDDEN_HOMONYM_FLAG = -1;
93 static constexpr size_t MAX_SUGGESTIONS = 16;
100 bool complex_prefixes = {};
102 bool checksharps = {};
103 bool forbid_warn = {};
104 char16_t compound_onlyin_flag = {};
105 char16_t circumfix_flag = {};
106 char16_t forbiddenword_flag = {};
107 char16_t keepcase_flag = {};
108 char16_t need_affix_flag = {};
109 char16_t warn_flag = {};
112 char16_t compound_flag = {};
113 char16_t compound_begin_flag = {};
114 char16_t compound_last_flag = {};
115 char16_t compound_middle_flag = {};
121 std::string ignored_chars = {};
122 icu::Locale icu_locale = {};
127 std::vector<Similarity_Group> similarities = {};
128 std::string keyboard_closeness = {};
129 std::string try_chars = {};
132 char16_t nosuggest_flag = {};
133 char16_t substandard_flag = {};
134 unsigned short max_compound_suggestions = {};
135 unsigned short max_ngram_suggestions = {};
136 unsigned short max_diff_factor = {};
137 bool only_max_diff = {};
138 bool no_split_suggestions = {};
139 bool suggest_with_dots = {};
142 unsigned short compound_min_length = {};
143 unsigned short compound_max_word_count = {};
144 char16_t compound_permit_flag = {};
145 char16_t compound_forbid_flag = {};
146 char16_t compound_root_flag = {};
147 char16_t compound_force_uppercase = {};
148 bool compound_more_suffixes = {};
149 bool compound_check_duplicate = {};
150 bool compound_check_rep = {};
151 bool compound_check_case = {};
152 bool compound_check_triple = {};
153 bool compound_simplified_triple = {};
154 bool compound_syllable_num = {};
155 unsigned short compound_syllable_max = {};
156 std::string compound_syllable_vowels = {};
157 std::vector<Compound_Pattern> compound_patterns = {};
160 Flag_Type flag_type = {};
162 std::vector<Flag_Set> flag_aliases = {};
163 std::string wordchars = {};
165 auto parse_aff(std::istream& in, std::ostream& err_msg) -> bool;
166 auto parse_dic(std::istream& in, std::ostream& err_msg) -> bool;
167 auto parse_aff_dic(std::istream& aff, std::istream& dic,
168 std::ostream& err_msg)
170 if (parse_aff(aff, err_msg))
171 return parse_dic(dic, err_msg);