1 #ifndef _SUGGESTMGR_HXX_
2 #define _SUGGESTMGR_HXX_
5 #define MAXSWUTF8L (MAXSWL * 4)
12 #define MAXPLUSTIMER 500
14 #define NGRAM_IGNORE_LENGTH 0
15 #define NGRAM_LONGER_WORSE 1
16 #define NGRAM_ANY_MISMATCH 2
19 #include "affixmgr.hxx"
20 #include "hashmgr.hxx"
21 #include "langnum.hxx"
24 enum { LCS_UP
, LCS_LEFT
, LCS_UPLEFT
};
34 struct cs_info
* csconv
;
42 SuggestMgr(const char * tryme
, int maxn
, AffixMgr
*aptr
);
45 int suggest(char*** slst
, const char * word
, int nsug
);
46 int ngsuggest(char ** wlst
, char * word
, HashMgr
* pHMgr
);
47 int suggest_auto(char*** slst
, const char * word
, int nsug
);
48 int suggest_stems(char*** slst
, const char * word
, int nsug
);
49 int suggest_pos_stems(char*** slst
, const char * word
, int nsug
);
51 char * suggest_morph(const char * word
);
52 char * suggest_morph_for_spelling_error(const char * word
);
55 int testsug(char** wlst
, const char * candidate
, int wl
, int ns
, int cpdsuggest
,
56 int * timer
, time_t * timelimit
);
57 int checkword(const char *, int, int, int *, time_t *);
58 int check_forbidden(const char *, int);
60 int capchars(char **, const char *, int, int);
61 int replchars(char**, const char *, int, int);
62 int doubletwochars(char**, const char *, int, int);
63 int forgotchar(char **, const char *, int, int);
64 int swapchar(char **, const char *, int, int);
65 int longswapchar(char **, const char *, int, int);
66 int movechar(char **, const char *, int, int);
67 int extrachar(char **, const char *, int, int);
68 int badchar(char **, const char *, int, int);
69 int twowords(char **, const char *, int, int);
70 int fixstems(char **, const char *, int);
72 int capchars_utf(char **, const w_char
*, int wl
, int, int);
73 int doubletwochars_utf(char**, const w_char
*, int wl
, int, int);
74 int forgotchar_utf(char**, const w_char
*, int wl
, int, int);
75 int extrachar_utf(char**, const w_char
*, int wl
, int, int);
76 int badchar_utf(char **, const w_char
*, int wl
, int, int);
77 int swapchar_utf(char **, const w_char
*, int wl
, int, int);
78 int longswapchar_utf(char **, const w_char
*, int, int, int);
79 int movechar_utf(char **, const w_char
*, int, int, int);
81 int mapchars(char**, const char *, int);
82 int map_related(const char *, int, char ** wlst
, int, const mapentry
*, int, int *, time_t *);
83 int map_related_utf(w_char
*, int, int, char ** wlst
, int, const mapentry
*, int, int *, time_t *);
84 int ngram(int n
, char * s1
, const char * s2
, int uselen
);
85 int mystrlen(const char * word
);
86 int equalfirstletter(char * s1
, const char * s2
);
87 int commoncharacterpositions(char * s1
, const char * s2
, int * is_swap
);
88 void bubblesort( char ** rwd
, int * rsc
, int n
);
89 void lcs(const char * s
, const char * s2
, int * l1
, int * l2
, char ** result
);
90 int lcslen(const char * s
, const char* s2
);