Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamlined suggest #565

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
68 changes: 0 additions & 68 deletions common/basic_list.hpp

This file was deleted.

2 changes: 2 additions & 0 deletions common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,8 @@ namespace acommon {
N_("use replacement tables, override sug-mode default")}
, {"sug-split-char", KeyInfoList, "\\ :-",
N_("characters to insert when a word is split"), KEYINFO_UTF8}
, {"sug-span", KeyInfoInt, "1",
N_("suggestions span, higher numbers return more results")}
, {"use-other-dicts", KeyInfoBool, "true",
N_("use personal, replacement & session dictionaries")}
, {"variety", KeyInfoList, "",
Expand Down
15 changes: 11 additions & 4 deletions modules/speller/default/asuggest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ namespace aspeller {
class SpellerImpl;
class Suggest;

enum Threshold {
T_UNLIKELY = 0,
T_MAYBE = 1,
T_PROBABLY = 2,
};

struct SuggestParms {
// implementation at the end of suggest.cc

Expand All @@ -21,18 +27,19 @@ namespace aspeller {

bool try_one_edit_word, try_scan_0, try_scan_1, try_scan_2, try_ngram;

int ngram_threshold, ngram_keep;
// continue if >=, setting to T_UNLIKELY means to always continue
Threshold scan_threshold, scan_2_threshold, ngram_threshold;

bool check_after_one_edit_word;
int ngram_keep;

bool use_typo_analysis;
bool use_repl_table;

int soundslike_weight;
int word_weight;

int skip;
int span;
int skip_score;
int span_levels, span;
int limit;

String split_chars;
Expand Down
Loading