1 | #ifndef DEFINE_FUNC_ATTRIBUTES |
2 | # define DEFINE_FUNC_ATTRIBUTES |
3 | #endif |
4 | #include "nvim/func_attr.h" |
5 | #undef DEFINE_FUNC_ATTRIBUTES |
6 | static void find_word(matchinf_T *mip, int mode); |
7 | static _Bool match_checkcompoundpattern(char_u *ptr, int wlen, garray_T *gap ); |
8 | static _Bool can_compound(slang_T *slang, char_u *word, char_u *flags); |
9 | static _Bool can_be_compound(trystate_T *sp, slang_T *slang, char_u *compflags, int flag); |
10 | static _Bool match_compoundrule(slang_T *slang, char_u *compflags); |
11 | static int valid_word_prefix(int totprefcnt, int arridx, int flags, char_u *word, slang_T *slang, _Bool cond_req ); |
12 | static void find_prefix(matchinf_T *mip, int mode); |
13 | static int fold_more(matchinf_T *mip); |
14 | static _Bool spell_valid_case(int wordflags, int treeflags); |
15 | static _Bool no_spell_checking(win_T *wp); |
16 | static void spell_load_lang(char_u *lang); |
17 | static void int_wordlist_spl(char_u *fname); |
18 | static void free_salitem(salitem_T *smp); |
19 | static void free_fromto(fromto_T *ftp); |
20 | static void spell_load_cb(char_u *fname, void *cookie); |
21 | static int score_wordcount_adj(slang_T *slang, int score, char_u *word, _Bool split ); |
22 | static int count_syllables(slang_T *slang, char_u *word); |
23 | static void clear_midword(win_T *wp); |
24 | static void use_midword(slang_T *lp, win_T *wp); |
25 | static int find_region(char_u *rp, char_u *region); |
26 | static int badword_captype(char_u *word, char_u *end) FUNC_ATTR_NONNULL_ALL; |
27 | static int bytes2offset(char_u **pp); |
28 | static _Bool spell_iswordp(char_u *p, win_T *wp); |
29 | static _Bool spell_mb_isword_class(int cl, win_T *wp); |
30 | static _Bool spell_iswordp_w(int *p, win_T *wp); |
31 | static _Bool check_need_cap(linenr_T lnum, colnr_T col); |
32 | static void spell_find_suggest(char_u *badptr, int badlen, suginfo_T *su, int maxcount, _Bool banbadword, _Bool need_cap, _Bool interactive ); |
33 | static void spell_suggest_expr(suginfo_T *su, char_u *expr); |
34 | static void spell_suggest_file(suginfo_T *su, char_u *fname); |
35 | static void spell_suggest_intern(suginfo_T *su, _Bool interactive); |
36 | static void spell_find_cleanup(suginfo_T *su); |
37 | static void allcap_copy(char_u *word, char_u *wcopy); |
38 | static void suggest_try_special(suginfo_T *su); |
39 | static void suggest_try_change(suginfo_T *su); |
40 | static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, _Bool soundfold); |
41 | static void go_deeper(trystate_T *stack, int depth, int score_add); |
42 | static int nofold_len(char_u *fword, int flen, char_u *word); |
43 | static void find_keepcap_word(slang_T *slang, char_u *fword, char_u *kword); |
44 | static void score_comp_sal(suginfo_T *su); |
45 | static void score_combine(suginfo_T *su); |
46 | static int stp_sal_score(suggest_T *stp, suginfo_T *su, slang_T *slang, char_u *badsound ); |
47 | static void suggest_try_soundalike_prep(void); |
48 | static void suggest_try_soundalike(suginfo_T *su); |
49 | static void suggest_try_soundalike_finish(void); |
50 | static void add_sound_suggest(suginfo_T *su, char_u *goodword, int score, langp_T *lp ); |
51 | static int soundfold_find(slang_T *slang, char_u *word); |
52 | static void make_case_word(char_u *fword, char_u *cword, int flags); |
53 | static _Bool similar_chars(slang_T *slang, int c1, int c2); |
54 | static void add_suggestion(suginfo_T *su, garray_T *gap, const char_u *goodword, int badlenarg, int score, int altscore, _Bool had_bonus, slang_T *slang, _Bool maxsf ); |
55 | static void check_suggestions(suginfo_T *su, garray_T *gap ); |
56 | static void add_banned(suginfo_T *su, char_u *word); |
57 | static void rescore_suggestions(suginfo_T *su); |
58 | static void rescore_one(suginfo_T *su, suggest_T *stp); |
59 | static int sug_compare(const void *s1, const void *s2); |
60 | static int cleanup_suggestions(garray_T *gap, int maxscore, int keep ); |
61 | static void spell_soundfold_sofo(slang_T *slang, char_u *inword, char_u *res); |
62 | static void spell_soundfold_sal(slang_T *slang, char_u *inword, char_u *res); |
63 | static void spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res); |
64 | static int soundalike_score(char_u *goodstart, char_u *badstart ); |
65 | static int spell_edit_score(slang_T *slang, char_u *badword, char_u *goodword); |
66 | static int spell_edit_score_limit(slang_T *slang, char_u *badword, char_u *goodword, int limit); |
67 | static int spell_edit_score_limit_w(slang_T *slang, char_u *badword, char_u *goodword, int limit); |
68 | static void dump_word(slang_T *slang, char_u *word, char_u *pat, int *dir, int dumpflags, int wordflags, linenr_T lnum); |
69 | static linenr_T dump_prefixes(slang_T *slang, char_u *word, char_u *pat, int *dir, int dumpflags, int flags, linenr_T startlnum ); |
70 | #include "nvim/func_attr.h" |
71 | |