Lines Matching refs:slang

132 static int count_syllables(slang_T *slang, char_u *word);
136 static void spell_soundfold_sofo(slang_T *slang, char_u *inword, char_u *res);
137 static void spell_soundfold_sal(slang_T *slang, char_u *inword, char_u *res);
138 static void spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res);
139 static void dump_word(slang_T *slang, char_u *word, char_u *pat, int *dir, int round, int flags, li…
140 static linenr_T dump_prefixes(slang_T *slang, char_u *word, char_u *pat, int *dir, int round, int f…
415 slang_T *slang = mip->mi_lp->lp_slang; in find_word() local
428 byts = slang->sl_kbyts; in find_word()
429 idxs = slang->sl_kidxs; in find_word()
440 byts = slang->sl_fbyts; in find_word()
441 idxs = slang->sl_fidxs; in find_word()
562 if (slang->sl_compprog == NULL && !slang->sl_nobreak) in find_word()
622 mip->mi_word + mip->mi_cprefixlen, slang, in find_word()
633 if (slang->sl_nobreak) in find_word()
654 || wlen - mip->mi_compoff < slang->sl_compminlen) in find_word()
659 && slang->sl_compminlen > 0 in find_word()
661 wlen - mip->mi_compoff) < slang->sl_compminlen) in find_word()
667 > slang->sl_compmax in find_word()
668 && slang->sl_compsylmax == MAXWLEN) in find_word()
680 ? slang->sl_compstartflags in find_word()
681 : slang->sl_compallflags, in find_word()
687 if (match_checkcompoundpattern(ptr, wlen, &slang->sl_comppat)) in find_word()
735 if (slang->sl_compsylmax < MAXWLEN) in find_word()
744 if (!can_compound(slang, fword, mip->mi_compflags)) in find_word()
747 else if (slang->sl_comprules != NULL in find_word()
748 && !match_compoundrule(slang, mip->mi_compflags)) in find_word()
772 if (slang->sl_nobreak) in find_word()
802 if (slang->sl_nobreak) in find_word()
815 if (!slang->sl_nobreak || mip->mi_result == SP_BAD) in find_word()
824 if (!slang->sl_nobreak || mip->mi_result == SP_BAD) in find_word()
833 if (!slang->sl_nobreak) in find_word()
841 if (slang->sl_nobreak) in find_word()
939 can_compound(slang_T *slang, char_u *word, char_u *flags) in can_compound() argument
945 if (slang->sl_compprog == NULL) in can_compound()
958 if (!vim_regexec_prog(&slang->sl_compprog, FALSE, p, 0)) in can_compound()
964 if (slang->sl_compsylmax < MAXWLEN in can_compound()
965 && count_syllables(slang, word) > slang->sl_compsylmax) in can_compound()
966 return (int)STRLEN(flags) < slang->sl_compmax; in can_compound()
977 match_compoundrule(slang_T *slang, char_u *compflags) in match_compoundrule() argument
984 for (p = slang->sl_comprules; *p != NUL; ++p) in match_compoundrule()
1035 slang_T *slang, in valid_word_prefix() argument
1046 pidx = slang->sl_pidxs[arridx + prefcnt]; in valid_word_prefix()
1059 rp = &slang->sl_prefprog[((unsigned)pidx >> 8) & 0xffff]; in valid_word_prefix()
1093 slang_T *slang = mip->mi_lp->lp_slang; in find_prefix() local
1097 byts = slang->sl_pbyts; in find_prefix()
1111 idxs = slang->sl_pidxs; in find_prefix()
1785 slang_T *slang; in spell_load_cb() local
1787 slang = spell_load_file(fname, slp->sl_lang, NULL, FALSE); in spell_load_cb()
1788 if (slang != NULL) in spell_load_cb()
1792 if (slp->sl_nobreak && slang->sl_add) in spell_load_cb()
1793 slang->sl_nobreak = TRUE; in spell_load_cb()
1794 else if (slang->sl_nobreak) in spell_load_cb()
1797 slp->sl_slang = slang; in spell_load_cb()
1875 init_syl_tab(slang_T *slang) in init_syl_tab() argument
1882 ga_init2(&slang->sl_syl_items, sizeof(syl_item_T), 4); in init_syl_tab()
1883 p = vim_strchr(slang->sl_syllable, '/'); in init_syl_tab()
1897 if (ga_grow(&slang->sl_syl_items, 1) == FAIL) in init_syl_tab()
1899 syl = ((syl_item_T *)slang->sl_syl_items.ga_data) in init_syl_tab()
1900 + slang->sl_syl_items.ga_len++; in init_syl_tab()
1913 count_syllables(slang_T *slang, char_u *word) in count_syllables() argument
1923 if (slang->sl_syllable == NULL) in count_syllables()
1938 for (i = 0; i < slang->sl_syl_items.ga_len; ++i) in count_syllables()
1940 syl = ((syl_item_T *)slang->sl_syl_items.ga_data) + i; in count_syllables()
1955 if (vim_strchr(slang->sl_syllable, c) == NULL) in count_syllables()
1980 slang_T *slang; in did_set_spelllang() local
2055 FOR_ALL_SPELL_LANGS(slang) in did_set_spelllang()
2056 if (fullpathcmp(lang, slang->sl_fname, FALSE, TRUE) == FPC_SAME) in did_set_spelllang()
2072 FOR_ALL_SPELL_LANGS(slang) in did_set_spelllang()
2073 if (STRICMP(lang, slang->sl_name) == 0) in did_set_spelllang()
2087 if (slang == NULL) in did_set_spelllang()
2107 FOR_ALL_SPELL_LANGS(slang) in did_set_spelllang()
2108 if (filename ? fullpathcmp(lang, slang->sl_fname, FALSE, TRUE) in did_set_spelllang()
2110 : STRICMP(lang, slang->sl_name) == 0) in did_set_spelllang()
2116 c = find_region(slang->sl_regions, region); in did_set_spelllang()
2119 if (slang->sl_add) in did_set_spelllang()
2121 if (*slang->sl_regions != NUL) in did_set_spelllang()
2143 LANGP_ENTRY(ga, ga.ga_len)->lp_slang = slang; in did_set_spelllang()
2146 use_midword(slang, wp); in did_set_spelllang()
2147 if (slang->sl_nobreak) in did_set_spelllang()
2186 FOR_ALL_SPELL_LANGS(slang) in did_set_spelllang()
2187 if (fullpathcmp(spf_name, slang->sl_fname, FALSE, TRUE) in did_set_spelllang()
2190 if (slang == NULL) in did_set_spelllang()
2204 slang = spell_load_file(spf_name, lang, NULL, TRUE); in did_set_spelllang()
2208 if (slang != NULL && nobreak) in did_set_spelllang()
2209 slang->sl_nobreak = TRUE; in did_set_spelllang()
2211 if (slang != NULL && ga_grow(&ga, 1) == OK) in did_set_spelllang()
2217 c = find_region(slang->sl_regions, use_region); in did_set_spelllang()
2220 else if (*slang->sl_regions != NUL) in did_set_spelllang()
2227 LANGP_ENTRY(ga, ga.ga_len)->lp_slang = slang; in did_set_spelllang()
2232 use_midword(slang, wp); in did_set_spelllang()
2444 slang_T *slang; in spell_free_all() local
2453 slang = first_lang; in spell_free_all()
2454 first_lang = slang->sl_next; in spell_free_all()
2455 slang_free(slang); in spell_free_all()
3098 slang_T *slang, in spell_soundfold() argument
3106 if (slang->sl_sofo) in spell_soundfold()
3108 spell_soundfold_sofo(slang, inword, res); in spell_soundfold()
3122 spell_soundfold_wsal(slang, word, res); in spell_soundfold()
3124 spell_soundfold_sal(slang, word, res); in spell_soundfold()
3133 spell_soundfold_sofo(slang_T *slang, char_u *inword, char_u *res) in spell_soundfold_sofo() argument
3152 c = slang->sl_sal_first[c]; in spell_soundfold_sofo()
3155 ip = ((int **)slang->sl_sal.ga_data)[c & 0xff]; in spell_soundfold_sofo()
3192 c = slang->sl_sal_first[c]; in spell_soundfold_sofo()
3202 spell_soundfold_sal(slang_T *slang, char_u *inword, char_u *res) in spell_soundfold_sal() argument
3222 if (slang->sl_rem_accents) in spell_soundfold_sal()
3244 smp = (salitem_T *)slang->sl_sal.ga_data; in spell_soundfold_sal()
3254 n = slang->sl_sal_first[c]; in spell_soundfold_sal()
3322 n0 = slang->sl_sal_first[c0]; in spell_soundfold_sal()
3324 if (slang->sl_followup && k > 1 && n0 >= 0 in spell_soundfold_sal()
3460 && (!slang->sl_collapse || reslen == 0 in spell_soundfold_sal()
3479 spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res) in spell_soundfold_wsal() argument
3481 salitem_T *smp = (salitem_T *)slang->sl_sal.ga_data; in spell_soundfold_wsal()
3513 if (slang->sl_rem_accents) in spell_soundfold_wsal()
3542 n = slang->sl_sal_first[c & 0xff]; in spell_soundfold_wsal()
3615 n0 = slang->sl_sal_first[c0 & 0xff]; in spell_soundfold_wsal()
3617 if (slang->sl_followup && k > 1 && n0 >= 0 in spell_soundfold_wsal()
3764 && (!slang->sl_collapse || reslen == 0 in spell_soundfold_wsal()
3869 slang_T *slang; in spell_dump_compl() local
3939 slang = lp->lp_slang; in spell_dump_compl()
3940 if (slang->sl_fbyts == NULL) // reloading failed in spell_dump_compl()
3945 vim_snprintf((char *)IObuff, IOSIZE, "# file: %s", slang->sl_fname); in spell_dump_compl()
3951 if (pat != NULL && slang->sl_pbyts == NULL) in spell_dump_compl()
3963 byts = slang->sl_fbyts; in spell_dump_compl()
3964 idxs = slang->sl_fidxs; in spell_dump_compl()
3969 byts = slang->sl_kbyts; in spell_dump_compl()
3970 idxs = slang->sl_kidxs; in spell_dump_compl()
4017 dump_word(slang, word, pat, dir, in spell_dump_compl()
4025 lnum = dump_prefixes(slang, word, pat, dir, in spell_dump_compl()
4058 slang_T *slang, in dump_word() argument
4120 hi = hash_find(&slang->sl_wordcount, tw); in dump_word()
4148 slang_T *slang, in dump_prefixes() argument
4179 byts = slang->sl_pbyts; in dump_prefixes()
4180 idxs = slang->sl_pidxs; in dump_prefixes()
4214 c = valid_word_prefix(i, n, flags, word, slang, FALSE); in dump_prefixes()
4218 dump_word(slang, prefix, pat, dir, dumpflags, in dump_prefixes()
4230 c = valid_word_prefix(i, n, flags, word_up, slang, in dump_prefixes()
4236 dump_word(slang, prefix, pat, dir, dumpflags, in dump_prefixes()