1 #ifndef _SUGGESTMGR_HXX_
2 #define _SUGGESTMGR_HXX_
5 #define MAXSWUTF8L (MAXSWL * 4)
11 #define MAXCOMPOUNDSUGS 3
13 // timelimit: max ~1/4 sec (process time on Linux) for a time consuming function
14 #define TIMELIMIT (CLOCKS_PER_SEC >> 2)
16 #define MAXPLUSTIMER 100
18 #define NGRAM_LONGER_WORSE (1 << 0)
19 #define NGRAM_ANY_MISMATCH (1 << 1)
20 #define NGRAM_LOWERING (1 << 2)
21 #define NGRAM_WEIGHTED (1 << 3)
23 #include "hunvisapi.h"
26 #include "affixmgr.hxx"
27 #include "hashmgr.hxx"
28 #include "langnum.hxx"
31 enum { LCS_UP
, LCS_LEFT
, LCS_UPLEFT
};
33 class LIBHUNSPELL_DLL_EXPORTED SuggestMgr
45 struct cs_info
* csconv
;
55 #ifdef HUNSPELL_CHROME_CLIENT
56 SuggestMgr(hunspell::BDictReader
* reader
, const char * tryme
, int maxn
, AffixMgr
*aptr
);
58 SuggestMgr(const char * tryme
, int maxn
, AffixMgr
*aptr
);
62 int suggest(char*** slst
, const char * word
, int nsug
, int * onlycmpdsug
);
63 int ngsuggest(char ** wlst
, char * word
, int ns
, HashMgr
** pHMgr
, int md
);
64 int suggest_auto(char*** slst
, const char * word
, int nsug
);
65 int suggest_stems(char*** slst
, const char * word
, int nsug
);
66 int suggest_pos_stems(char*** slst
, const char * word
, int nsug
);
68 char * suggest_morph(const char * word
);
69 char * suggest_gen(char ** pl
, int pln
, char * pattern
);
70 char * suggest_morph_for_spelling_error(const char * word
);
73 #ifdef HUNSPELL_CHROME_CLIENT
74 // Not owned by us, owned by the Hunspell object.
75 hunspell::BDictReader
* bdict_reader
;
77 int testsug(char** wlst
, const char * candidate
, int wl
, int ns
, int cpdsuggest
,
78 int * timer
, clock_t * timelimit
);
79 int checkword(const char *, int, int, int *, clock_t *);
80 int check_forbidden(const char *, int);
82 int capchars(char **, const char *, int, int);
83 int replchars(char**, const char *, int, int);
84 int doubletwochars(char**, const char *, int, int);
85 int forgotchar(char **, const char *, int, int);
86 int swapchar(char **, const char *, int, int);
87 int longswapchar(char **, const char *, int, int);
88 int movechar(char **, const char *, int, int);
89 int extrachar(char **, const char *, int, int);
90 int badcharkey(char **, const char *, int, int);
91 int badchar(char **, const char *, int, int);
92 int twowords(char **, const char *, int, int);
93 int fixstems(char **, const char *, int);
95 int capchars_utf(char **, const w_char
*, int wl
, int, int);
96 int doubletwochars_utf(char**, const w_char
*, int wl
, int, int);
97 int forgotchar_utf(char**, const w_char
*, int wl
, int, int);
98 int extrachar_utf(char**, const w_char
*, int wl
, int, int);
99 int badcharkey_utf(char **, const w_char
*, int wl
, int, int);
100 int badchar_utf(char **, const w_char
*, int wl
, int, int);
101 int swapchar_utf(char **, const w_char
*, int wl
, int, int);
102 int longswapchar_utf(char **, const w_char
*, int, int, int);
103 int movechar_utf(char **, const w_char
*, int, int, int);
105 int mapchars(char**, const char *, int, int);
106 int map_related(const char *, char *, int, int, char ** wlst
, int, int, const mapentry
*, int, int *, clock_t *);
107 int ngram(int n
, char * s1
, const char * s2
, int opt
);
108 int mystrlen(const char * word
);
109 int leftcommonsubstring(char * s1
, const char * s2
);
110 int commoncharacterpositions(char * s1
, const char * s2
, int * is_swap
);
111 void bubblesort( char ** rwd
, char ** rwd2
, int * rsc
, int n
);
112 void lcs(const char * s
, const char * s2
, int * l1
, int * l2
, char ** result
);
113 int lcslen(const char * s
, const char* s2
);
114 char * suggest_hentry_gen(hentry
* rv
, char * pattern
);