Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–510 unchanged (510 lines)
511 spell_find_suggest(line + curwin->w_cursor.col, badlen, &sug, limit,
512 true, need_cap, true);
513
514 int selected = count;
515 msg_ext_set_kind("confirm");
516 if (GA_EMPTY(&sug.su_ga)) {
517 msg(_("Sorry, no suggestions"), 0);
518 } else if (count > 0) {
519 if (count > sug.su_ga.ga_len) {
520 smsg(0, _("Sorry, only %" PRId64 " suggestions"),
521 (int64_t)sug.su_ga.ga_len);
522 }
523 } else {
524 // When 'rightleft' is set the list is drawn right-left.
525 cmdmsg_rl = curwin->w_p_rl;
526
…lines 527–3716 unchanged (3190 lines)

After

…lines 1–510 unchanged (510 lines)
511 spell_find_suggest(line + curwin->w_cursor.col, badlen, &sug, limit,
512 true, need_cap, true);
513
514 int selected = count;
515 msg_ext_set_kind("confirm");
516 if (GA_EMPTY(&sug.su_ga)) {
517 msg(_("No suggestions"), 0);
518 } else if (count > 0) {
519 if (count > sug.su_ga.ga_len) {
520 smsg(0, _("Only %" PRId64 " suggestions"),
521 (int64_t)sug.su_ga.ga_len);
522 }
523 } else {
524 // When 'rightleft' is set the list is drawn right-left.
525 cmdmsg_rl = curwin->w_p_rl;
526
…lines 527–3716 unchanged (3190 lines)

Before

translation_unit
comment "// spellsuggest.c: functions for spelling suggestions"
preproc_include
#include "#include"
system_lib_string "<assert.h>"
preproc_include
#include "#include"
system_lib_string "<inttypes.h>"
preproc_include
#include "#include"
system_lib_string "<limits.h>"
preproc_include
#include "#include"
system_lib_string "<stdbool.h>"
preproc_include
#include "#include"
system_lib_string "<stddef.h>"
preproc_include
#include "#include"
system_lib_string "<stdio.h>"
preproc_include
#include "#include"
system_lib_string "<stdlib.h>"
preproc_include
#include "#include"
system_lib_string "<string.h>"
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/ascii_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/buffer_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/change.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/charset.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/cursor.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/errors.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/eval/typval.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/eval/typval_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/eval/vars.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/fileio.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/garray.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/garray_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/getchar.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/gettext_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/globals.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/hashtab.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/hashtab_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/highlight_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/input.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/macros_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/mbyte.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/mbyte_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/memline.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/memory.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/message.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/normal.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/option.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/option_vars.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/os/fs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/os/input.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/os/os_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/pos_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/profile.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/spell.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/spell_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/spellfile.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/spellsuggest.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/strings.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/types_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/ui.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/ui_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/undo.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/vim_defs.h"
" "\""
comment "// Use this to adjust the score after finding suggestions, b"...
comment "// suggested word sounding like the bad word. This is much "...
comment "// it for every possible suggestion."
comment "// Disadvantage: When \"the\" is typed as \"hte\" it sounds quit"...
comment "// vs \"ht\") and goes down in the list."
comment "// Used when 'spellsuggest' is set to \"best\"."
preproc_function_def
#define "#define"
identifier "RESCORE"
preproc_params
( "("
identifier "word_score"
, ","
identifier "sound_score"
) ")"
preproc_arg "((3 * (word_score) + (sound_score)) / 4)"
comment "// Do the opposite: based on a maximum end score and a known"...
comment "// compute the maximum word score that can be used."
preproc_function_def
#define "#define"
identifier "MAXSCORE"
preproc_params
( "("
identifier "word_score"
, ","
identifier "sound_score"
) ")"
preproc_arg "((4 * (word_score) - (sound_score)) / 3)"
comment "// only used for su_badflags"
preproc_def
#define "#define"
identifier "WF_MIXCAP"
preproc_arg "0x20 // mix of upper and lower case: macaRONI"
comment "/// Information used when looking for suggestions."
type_definition (+90 nodes collapsed)
comment "/// One word suggestion. Used in \"si_ga\"."
type_definition (+53 nodes collapsed)
preproc_function_def
#define "#define"
identifier "SUG"
preproc_params
( "("
identifier "ga"
, ","
identifier "i"
) ")"
preproc_arg "(((suggest_T *)(ga).ga_data)[i])"
comment "// True if a word appears in the list of banned words."
preproc_function_def
#define "#define"
identifier "WAS_BANNED"
preproc_params
( "("
identifier "su"
, ","
identifier "word"
) ")"
preproc_arg "(!HASHITEM_EMPTY(hash_find(&(su)->su_banned, word)))"
comment "// Number of suggestions kept when cleaning up. We need to "...
comment "// what is displayed, because when rescore_suggestions() is "...
comment "// may change and wrong suggestions may be removed later."
preproc_function_def
#define "#define"
identifier "SUG_CLEAN_COUNT"
preproc_params
( "("
identifier "su"
) ")"
preproc_arg "((su)->su_maxcount < \\\n 130 ?"...
comment "// Threshold for sorting and cleaning up suggestions. Don't"...
comment "// of suggestions that are not going to be displayed."
preproc_function_def
#define "#define"
identifier "SUG_MAX_COUNT"
preproc_params
( "("
identifier "su"
) ")"
preproc_arg "(SUG_CLEAN_COUNT(su) + 50)"
comment "// score for various changes"
enum_specifier (+113 nodes collapsed)
; ";"
enum_specifier
enum "enum"
enumerator_list
{ "{"
enumerator
identifier "SCORE_FILE"
= "="
number_literal "30"
, ","
comment "// suggestion from a file"
enumerator
identifier "SCORE_MAXINIT"
= "="
number_literal "350"
, ","
comment "// Initial maximum score: higher == slower."
comment "// 350 allows for about three changes."
} "}"
; ";"
enum_specifier (+35 nodes collapsed)
; ";"
comment "// When trying changed soundfold words it becomes slow when "...
comment "// two changes. With less than two changes it's slightly fa"...
comment "// few good suggestions. In rare cases we need to try three"...
enum_specifier (+23 nodes collapsed)
; ";"
preproc_def
#define "#define"
identifier "SCORE_BIG"
preproc_arg "(SCORE_INS * 3) // big difference"
enum_specifier
enum "enum"
enumerator_list
{ "{"
enumerator
identifier "SCORE_MAXMAX"
= "="
number_literal "999999"
, ","
comment "// accept any score"
enumerator
identifier "SCORE_LIMITMAX"
= "="
number_literal "350"
, ","
comment "// for spell_edit_score_limit()"
} "}"
; ";"
comment "// for spell_edit_score_limit() we need to know the minimum "...
comment "// SCORE_ICASE, SCORE_SWAP, SCORE_DEL, SCORE_SIMILAR and SCO"...
preproc_def
#define "#define"
identifier "SCORE_EDIT_MIN"
preproc_arg "SCORE_SIMILAR"
comment "/// For finding suggestions: At each node in the tree these "...
type_definition (+85 nodes collapsed)
comment "/// Struct to keep the state at each level in suggest_try_ch"...
type_definition (+111 nodes collapsed)
comment "// values for ts_isdiff"
enum_specifier (+23 nodes collapsed)
; ";"
comment "// values for ts_flags"
enum_specifier (+23 nodes collapsed)
; ";"
comment "// special values ts_prefixdepth"
enum_specifier (+23 nodes collapsed)
; ";"
declaration
storage_class_specifier
static "static"
primitive_type "int"
init_declarator
identifier "spell_suggest_timeout"
= "="
number_literal "5000"
; ";"
preproc_include
#include "#include"
string_literal
" "\""
string_content "spellsuggest.c.generated.h"
" "\""
comment "/// Returns true when the sequence of flags in \"compflags\" p"...
comment "/// possibly form a valid compounded word. This also checks"...
comment "/// lines if they don't contain wildcards."
function_definition (+183 nodes collapsed)
comment "/// Adjust the score of common words."
comment "///"
comment "/// @param split word was split, less bonus"
function_definition (+184 nodes collapsed)
comment "/// Like captype() but for a KEEPCAP word add ONECAP if the "...
comment "/// capital. So that make_case_word() can turn WOrd into Wo"...
comment "/// Add ALLCAP for \"WOrD\"."
function_definition (+241 nodes collapsed)
comment "/// Opposite of offset2bytes()."
comment "/// \"pp\" points to the bytes and is advanced over it."
comment "///"
comment "/// @return the offset."
function_definition (+327 nodes collapsed)
comment "// values for sps_flags"
enum_specifier
enum "enum"
enumerator_list
{ "{"
enumerator
identifier "SPS_BEST"
= "="
number_literal "1"
, ","
enumerator
identifier "SPS_FAST"
= "="
number_literal "2"
, ","
enumerator
identifier "SPS_DOUBLE"
= "="
number_literal "4"
, ","
} "}"
; ";"
declaration
storage_class_specifier
static "static"
primitive_type "int"
init_declarator
identifier "sps_flags"
= "="
identifier "SPS_BEST"
; ";"
comment "///< flags from 'spellsuggest'"
declaration
storage_class_specifier
static "static"
primitive_type "int"
init_declarator
identifier "sps_limit"
= "="
number_literal "9999"
; ";"
comment "///< max nr of suggestions given"
comment "/// Check the 'spellsuggest' option. Return FAIL if it's wr"...
comment "/// Sets \"sps_flags\" and \"sps_limit\"."
function_definition (+447 nodes collapsed)
comment "/// \"z=\": Find badly spelled word under or after the cursor."
comment "/// Give suggestions for the properly spelled word."
comment "/// In Visual mode use the highlighted word as the bad word."
comment "/// When \"count\" is non-zero use that suggestion."
function_definition
primitive_type "void"
function_declarator
identifier "spell_suggest"
parameter_list
( "("
parameter_declaration
primitive_type "int"
identifier "count"
) ")"
compound_statement
{ "{"
declaration
type_identifier "pos_T"
init_declarator
identifier "prev_cursor"
= "="
field_expression
identifier "curwin"
-> "->"
field_identifier "w_cursor"
; ";"
declaration
primitive_type "bool"
init_declarator
identifier "mouse_used"
= "="
false "false"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "badlen"
= "="
number_literal "0"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "msg_scroll_save"
= "="
identifier "msg_scroll"
; ";"
declaration
type_qualifier
const "const"
primitive_type "int"
init_declarator
identifier "wo_spell_save"
= "="
field_expression
identifier "curwin"
-> "->"
field_identifier "w_p_spell"
; ";"
if_statement (+31 nodes collapsed)
if_statement (+37 nodes collapsed)
if_statement (+358 nodes collapsed)
comment "// Get the word and its length."
comment "// Figure out if the word should be capitalised."
declaration (+28 nodes collapsed)
comment "// Make a copy of current line since autocommands may free t"...
declaration (+29 nodes collapsed)
expression_statement
assignment_expression
identifier "spell_suggest_timeout"
= "="
number_literal "5000"
; ";"
comment "// Get the list of suggestions. Limit to 'lines' - 2 or the"...
comment "// 'spellsuggest', whatever is smaller."
declaration
type_identifier "suginfo_T"
identifier "sug"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "limit"
= "="
call_expression
identifier "MIN"
argument_list
( "("
identifier "sps_limit"
, ","
binary_expression
identifier "Rows"
- "-"
number_literal "2"
) ")"
; ";"
expression_statement (+31 nodes collapsed)
declaration
primitive_type "int"
init_declarator
identifier "selected"
= "="
identifier "count"
; ";"
expression_statement
call_expression
identifier "msg_ext_set_kind"
argument_list
( "("
string_literal
" "\""
string_content "confirm"
" "\""
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "GA_EMPTY"
argument_list
( "("
pointer_expression
& "&"
field_expression
identifier "sug"
. "."
field_identifier "su_ga"
) ")"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "msg"
argument_list
( "("
call_expression
identifier "_"
argument_list
( "("
string_literal
" "\""
string_content "Sorry, no suggestions"
" "\""
) ")"
, ","
number_literal "0"
) ")"
; ";"
} "}"
else_clause
else "else"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "count"
> ">"
number_literal "0"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "count"
> ">"
field_expression
field_expression
identifier "sug"
. "."
field_identifier "su_ga"
. "."
field_identifier "ga_len"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "smsg"
argument_list
( "("
number_literal "0"
, ","
call_expression
identifier "_"
argument_list
( "("
concatenated_string
string_literal
" "\""
string_content "Sorry, only %"
" "\""
identifier "PRId64"
string_literal
" "\""
string_content " suggestions"
" "\""
) ")"
, ","
cast_expression
( "("
type_descriptor
primitive_type "int64_t"
) ")"
field_expression
field_expression
identifier "sug"
. "."
field_identifier "su_ga"
. "."
field_identifier "ga_len"
) ")"
; ";"
} "}"
} "}"
else_clause (+718 nodes collapsed)
if_statement (+460 nodes collapsed)
expression_statement
call_expression
identifier "spell_find_cleanup"
argument_list
( "("
pointer_expression
& "&"
identifier "sug"
) ")"
; ";"
expression_statement
call_expression
identifier "xfree"
argument_list
( "("
identifier "line"
) ")"
; ";"
labeled_statement
statement_identifier "skip"
: ":"
expression_statement
assignment_expression
field_expression
identifier "curwin"
-> "->"
field_identifier "w_p_spell"
= "="
identifier "wo_spell_save"
; ";"
} "}"
comment "/// Find spell suggestions for \"word\". Return them in the g"...
comment "/// a list of allocated strings."
comment "///"
comment "/// @param maxcount maximum nr of suggestions"
comment "/// @param need_cap 'spellcapcheck' matched"
function_definition (+275 nodes collapsed)
comment "/// Find spell suggestions for the word at the start of \"bad"...
comment "/// Return the suggestions in \"su->su_ga\"."
comment "/// The maximum number of suggestions is \"maxcount\"."
comment "/// Note: does use info for the current window."
comment "/// This is based on the mechanisms of Aspell, but completel"...
comment "///"
comment "/// @param badlen length of bad word or 0 if unknown"
comment "/// @param banbadword don't include badword in suggestions"
comment "/// @param need_cap word should start with capital"
function_definition (+936 nodes collapsed)
comment "/// Find suggestions by evaluating expression \"expr\"."
function_definition (+234 nodes collapsed)
comment "/// Find suggestions in file \"fname\". Used for \"file:\" in '"...
function_definition (+369 nodes collapsed)
comment "/// Find suggestions for the internal method indicated by \"s"...
function_definition (+384 nodes collapsed)
comment "/// Free the info put in \"*su\" by spell_find_suggest()."
function_definition (+76 nodes collapsed)
comment "/// Try finding suggestions by recognizing specific situatio"...
function_definition (+214 nodes collapsed)
comment "// Measure how much time is spent in each state."
comment "// Output is dumped in \"suggestprof\"."
preproc_ifdef (+354 nodes collapsed)
comment "/// Try finding suggestions by adding/removing/swapping lett"...
function_definition (+269 nodes collapsed)
comment "// Check the maximum score, if we go over it we won't try th"...
preproc_function_def
#define "#define"
identifier "TRY_DEEPER"
preproc_params
( "("
identifier "su"
, ","
identifier "stack"
, ","
identifier "depth"
, ","
identifier "add"
) ")"
preproc_arg "((depth) < MAXWLEN - 1 && (stack)[depth].ts_score + (add) < "...
comment "/// Try finding suggestions by adding/removing/swapping lett"...
comment "///"
comment "/// This uses a state machine. At each node in the tree we "...
comment "/// operations. When trying if an operation works \"depth\" i"...
comment "/// stack[] is used to store info. This allows combinations"...
comment "/// character, replace one and delete another. The number o"...
comment "/// limited by su->su_maxscore."
comment "///"
comment "/// After implementing this I noticed an article by Kemal Of"...
comment "/// describes something similar: \"Error-tolerant Finite Stat"...
comment "/// Applications to Morphological Analysis and Spelling Corr"...
comment "/// The implementation in the article is simplified and requ"...
comment "/// unknown depth. The implementation here only needs a sta"...
comment "/// the length of the word."
comment "///"
comment "/// This is also used for the sound-folded word, \"soundfold\""...
comment "/// The mechanism is the same, but we find a match with a so"...
comment "/// that comes from one or more original words. Each of the"...
comment "/// added, this is done by add_sound_suggest()."
comment "/// Don't use:"
comment "/// the prefix tree or the keep-case tree"
comment "/// \"su->su_badlen\""
comment "/// anything to do with upper and lower case"
comment "/// anything to do with word or non-word characters (\"s"...
comment "/// banned words"
comment "/// word flags (rare, region, compounding)"
comment "/// word splitting for now"
comment "/// \"similar_chars()\""
comment "/// use \"slang->sl_repsal\" instead of \"lp->lp_replang->"...
function_definition (+9033 nodes collapsed)
comment "/// Go one level deeper in the tree."
function_definition (+117 nodes collapsed)
comment "/// \"fword\" is a good word with case folded. Find the match"...
comment "/// words and put it in \"kword\"."
comment "/// Theoretically there could be several keep-case words tha"...
comment "/// same case-folded word, but we only find one..."
function_definition (+850 nodes collapsed)
comment "/// Compute the sound-a-like score for suggestions in su->su"...
comment "/// su->su_sga."
function_definition (+330 nodes collapsed)
comment "/// Combine the list of suggestions in su->su_ga and su->su_"...
comment "/// They are entwined."
function_definition (+985 nodes collapsed)
comment "/// For the goodword in \"stp\" compute the soundalike score c"...
comment "/// badword."
comment "///"
comment "/// @param badsound sound-folded badword"
function_definition (+372 nodes collapsed)
comment "/// structure used to store soundfolded words that add_sound"...
comment "/// handled already."
type_definition (+22 nodes collapsed)
declaration
storage_class_specifier
static "static"
type_identifier "sftword_T"
identifier "dumsft"
; ";"
preproc_function_def
#define "#define"
identifier "HIKEY2SFT"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "((sftword_T *)((p) - (dumsft.sft_word - (uint8_t *)&dumsft))"...
preproc_function_def
#define "#define"
identifier "HI2SFT"
preproc_params
( "("
identifier "hi"
) ")"
preproc_arg "HIKEY2SFT((hi)->hi_key)"
comment "/// Prepare for calling suggest_try_soundalike()."
function_definition (+126 nodes collapsed)
comment "/// Find suggestions by comparing the word in a sound-a-like"...
comment "/// Note: This doesn't support postponed prefixes."
function_definition (+184 nodes collapsed)
comment "/// Finish up after calling suggest_try_soundalike()."
function_definition (+222 nodes collapsed)
comment "/// A match with a soundfolded word is found. Add the good "...
comment "/// produce this soundfolded word."
comment "///"
comment "/// @param score soundfold score"
function_definition (+1253 nodes collapsed)
comment "/// Find word \"word\" in fold-case tree for \"slang\" and retur"...
function_definition (+393 nodes collapsed)
comment "/// Returns true if \"c1\" and \"c2\" are similar characters acc"...
comment "/// lines in the .aff file."
function_definition (+307 nodes collapsed)
comment "/// Adds a suggestion to the list of suggestions."
comment "/// For a suggestion that is already in the list the lowest "...
comment "///"
comment "/// @param gap either su_ga or su_sga"
comment "/// @param badlenarg len of bad word replaced with \"goodwor"...
comment "/// @param had_bonus value for st_had_bonus"
comment "/// @param slang language for sound folding"
comment "/// @param maxsf su_maxscore applies to soundfold score, su"...
function_definition (+773 nodes collapsed)
comment "/// Suggestions may in fact be flagged as errors. Esp. for "...
comment "/// for split words, such as \"the the\". Remove these from t"...
comment "///"
comment "/// @param gap either su_ga or su_sga"
function_definition (+296 nodes collapsed)
comment "/// Add a word to be banned."
function_definition (+129 nodes collapsed)
comment "/// Recompute the score for all suggestions if sound-folding"...
comment "/// is slow, thus only done for the final results."
function_definition (+83 nodes collapsed)
comment "/// Recompute the score for one suggestion if sound-folding "...
function_definition (+214 nodes collapsed)
comment "/// Function given to qsort() to sort the suggestions on st_"...
comment "/// First on \"st_score\", then \"st_altscore\" then alphabetica"...
function_definition (+175 nodes collapsed)
comment "/// Cleanup the suggestions:"
comment "/// - Sort on score."
comment "/// - Remove words that won't be displayed."
comment "///"
comment "/// @param keep nr of suggestions to keep"
comment "///"
comment "/// @return the maximum score in the list or \"maxscore\" unm"...
function_definition (+193 nodes collapsed)
comment "/// Compute a score for two sound-a-like words."
comment "/// This permits up to two inserts/deletes/swaps/etc. to kee"...
comment "/// Instead of a generic loop we write out the code. That k"...
comment "/// avoiding checks that will not be possible."
comment "///"
comment "/// @param goodstart sound-folded good word"
comment "/// @param badstart sound-folded bad word"
function_definition (+1441 nodes collapsed)
comment "/// Compute the \"edit distance\" to turn \"badword\" into \"good"...
comment "/// deletes/inserts/substitutes/swaps are required the lower"...
comment "///"
comment "/// The algorithm is described by Du and Chang, 1992."
comment "/// The implementation of the algorithm comes from Aspell ed"...
comment "/// edit_distance(). It has been converted from C++ to C an"...
comment "/// support multi-byte characters."
function_definition (+838 nodes collapsed)
type_definition (+21 nodes collapsed)
comment "/// Like spell_edit_score(), but with a limit on the score t"...
comment "/// May return SCORE_MAXMAX when the score is higher than \"l"...
comment "///"
comment "/// This uses a stack for the edits still to be tried."
comment "/// The idea comes from Aspell leditdist.cpp. Rewritten in "...
comment "/// for multi-byte characters."
function_definition (+48 nodes collapsed)
comment "/// Multi-byte version of spell_edit_score_limit()."
comment "/// Keep it in sync with the above!"
function_definition (+960 nodes collapsed)

After

translation_unit
comment "// spellsuggest.c: functions for spelling suggestions"
preproc_include
#include "#include"
system_lib_string "<assert.h>"
preproc_include
#include "#include"
system_lib_string "<inttypes.h>"
preproc_include
#include "#include"
system_lib_string "<limits.h>"
preproc_include
#include "#include"
system_lib_string "<stdbool.h>"
preproc_include
#include "#include"
system_lib_string "<stddef.h>"
preproc_include
#include "#include"
system_lib_string "<stdio.h>"
preproc_include
#include "#include"
system_lib_string "<stdlib.h>"
preproc_include
#include "#include"
system_lib_string "<string.h>"
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/ascii_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/buffer_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/change.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/charset.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/cursor.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/errors.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/eval/typval.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/eval/typval_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/eval/vars.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/fileio.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/garray.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/garray_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/getchar.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/gettext_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/globals.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/hashtab.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/hashtab_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/highlight_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/input.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/macros_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/mbyte.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/mbyte_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/memline.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/memory.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/message.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/normal.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/option.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/option_vars.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/os/fs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/os/input.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/os/os_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/pos_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/profile.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/spell.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/spell_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/spellfile.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/spellsuggest.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/strings.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/types_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/ui.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/ui_defs.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/undo.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "nvim/vim_defs.h"
" "\""
comment "// Use this to adjust the score after finding suggestions, b"...
comment "// suggested word sounding like the bad word. This is much "...
comment "// it for every possible suggestion."
comment "// Disadvantage: When \"the\" is typed as \"hte\" it sounds quit"...
comment "// vs \"ht\") and goes down in the list."
comment "// Used when 'spellsuggest' is set to \"best\"."
preproc_function_def
#define "#define"
identifier "RESCORE"
preproc_params
( "("
identifier "word_score"
, ","
identifier "sound_score"
) ")"
preproc_arg "((3 * (word_score) + (sound_score)) / 4)"
comment "// Do the opposite: based on a maximum end score and a known"...
comment "// compute the maximum word score that can be used."
preproc_function_def
#define "#define"
identifier "MAXSCORE"
preproc_params
( "("
identifier "word_score"
, ","
identifier "sound_score"
) ")"
preproc_arg "((4 * (word_score) - (sound_score)) / 3)"
comment "// only used for su_badflags"
preproc_def
#define "#define"
identifier "WF_MIXCAP"
preproc_arg "0x20 // mix of upper and lower case: macaRONI"
comment "/// Information used when looking for suggestions."
type_definition (+90 nodes collapsed)
comment "/// One word suggestion. Used in \"si_ga\"."
type_definition (+53 nodes collapsed)
preproc_function_def
#define "#define"
identifier "SUG"
preproc_params
( "("
identifier "ga"
, ","
identifier "i"
) ")"
preproc_arg "(((suggest_T *)(ga).ga_data)[i])"
comment "// True if a word appears in the list of banned words."
preproc_function_def
#define "#define"
identifier "WAS_BANNED"
preproc_params
( "("
identifier "su"
, ","
identifier "word"
) ")"
preproc_arg "(!HASHITEM_EMPTY(hash_find(&(su)->su_banned, word)))"
comment "// Number of suggestions kept when cleaning up. We need to "...
comment "// what is displayed, because when rescore_suggestions() is "...
comment "// may change and wrong suggestions may be removed later."
preproc_function_def
#define "#define"
identifier "SUG_CLEAN_COUNT"
preproc_params
( "("
identifier "su"
) ")"
preproc_arg "((su)->su_maxcount < \\\n 130 ?"...
comment "// Threshold for sorting and cleaning up suggestions. Don't"...
comment "// of suggestions that are not going to be displayed."
preproc_function_def
#define "#define"
identifier "SUG_MAX_COUNT"
preproc_params
( "("
identifier "su"
) ")"
preproc_arg "(SUG_CLEAN_COUNT(su) + 50)"
comment "// score for various changes"
enum_specifier (+113 nodes collapsed)
; ";"
enum_specifier
enum "enum"
enumerator_list
{ "{"
enumerator
identifier "SCORE_FILE"
= "="
number_literal "30"
, ","
comment "// suggestion from a file"
enumerator
identifier "SCORE_MAXINIT"
= "="
number_literal "350"
, ","
comment "// Initial maximum score: higher == slower."
comment "// 350 allows for about three changes."
} "}"
; ";"
enum_specifier (+35 nodes collapsed)
; ";"
comment "// When trying changed soundfold words it becomes slow when "...
comment "// two changes. With less than two changes it's slightly fa"...
comment "// few good suggestions. In rare cases we need to try three"...
enum_specifier (+23 nodes collapsed)
; ";"
preproc_def
#define "#define"
identifier "SCORE_BIG"
preproc_arg "(SCORE_INS * 3) // big difference"
enum_specifier
enum "enum"
enumerator_list
{ "{"
enumerator
identifier "SCORE_MAXMAX"
= "="
number_literal "999999"
, ","
comment "// accept any score"
enumerator
identifier "SCORE_LIMITMAX"
= "="
number_literal "350"
, ","
comment "// for spell_edit_score_limit()"
} "}"
; ";"
comment "// for spell_edit_score_limit() we need to know the minimum "...
comment "// SCORE_ICASE, SCORE_SWAP, SCORE_DEL, SCORE_SIMILAR and SCO"...
preproc_def
#define "#define"
identifier "SCORE_EDIT_MIN"
preproc_arg "SCORE_SIMILAR"
comment "/// For finding suggestions: At each node in the tree these "...
type_definition (+85 nodes collapsed)
comment "/// Struct to keep the state at each level in suggest_try_ch"...
type_definition (+111 nodes collapsed)
comment "// values for ts_isdiff"
enum_specifier (+23 nodes collapsed)
; ";"
comment "// values for ts_flags"
enum_specifier (+23 nodes collapsed)
; ";"
comment "// special values ts_prefixdepth"
enum_specifier (+23 nodes collapsed)
; ";"
declaration
storage_class_specifier
static "static"
primitive_type "int"
init_declarator
identifier "spell_suggest_timeout"
= "="
number_literal "5000"
; ";"
preproc_include
#include "#include"
string_literal
" "\""
string_content "spellsuggest.c.generated.h"
" "\""
comment "/// Returns true when the sequence of flags in \"compflags\" p"...
comment "/// possibly form a valid compounded word. This also checks"...
comment "/// lines if they don't contain wildcards."
function_definition (+183 nodes collapsed)
comment "/// Adjust the score of common words."
comment "///"
comment "/// @param split word was split, less bonus"
function_definition (+184 nodes collapsed)
comment "/// Like captype() but for a KEEPCAP word add ONECAP if the "...
comment "/// capital. So that make_case_word() can turn WOrd into Wo"...
comment "/// Add ALLCAP for \"WOrD\"."
function_definition (+241 nodes collapsed)
comment "/// Opposite of offset2bytes()."
comment "/// \"pp\" points to the bytes and is advanced over it."
comment "///"
comment "/// @return the offset."
function_definition (+327 nodes collapsed)
comment "// values for sps_flags"
enum_specifier
enum "enum"
enumerator_list
{ "{"
enumerator
identifier "SPS_BEST"
= "="
number_literal "1"
, ","
enumerator
identifier "SPS_FAST"
= "="
number_literal "2"
, ","
enumerator
identifier "SPS_DOUBLE"
= "="
number_literal "4"
, ","
} "}"
; ";"
declaration
storage_class_specifier
static "static"
primitive_type "int"
init_declarator
identifier "sps_flags"
= "="
identifier "SPS_BEST"
; ";"
comment "///< flags from 'spellsuggest'"
declaration
storage_class_specifier
static "static"
primitive_type "int"
init_declarator
identifier "sps_limit"
= "="
number_literal "9999"
; ";"
comment "///< max nr of suggestions given"
comment "/// Check the 'spellsuggest' option. Return FAIL if it's wr"...
comment "/// Sets \"sps_flags\" and \"sps_limit\"."
function_definition (+447 nodes collapsed)
comment "/// \"z=\": Find badly spelled word under or after the cursor."
comment "/// Give suggestions for the properly spelled word."
comment "/// In Visual mode use the highlighted word as the bad word."
comment "/// When \"count\" is non-zero use that suggestion."
function_definition
primitive_type "void"
function_declarator
identifier "spell_suggest"
parameter_list
( "("
parameter_declaration
primitive_type "int"
identifier "count"
) ")"
compound_statement
{ "{"
declaration
type_identifier "pos_T"
init_declarator
identifier "prev_cursor"
= "="
field_expression
identifier "curwin"
-> "->"
field_identifier "w_cursor"
; ";"
declaration
primitive_type "bool"
init_declarator
identifier "mouse_used"
= "="
false "false"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "badlen"
= "="
number_literal "0"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "msg_scroll_save"
= "="
identifier "msg_scroll"
; ";"
declaration
type_qualifier
const "const"
primitive_type "int"
init_declarator
identifier "wo_spell_save"
= "="
field_expression
identifier "curwin"
-> "->"
field_identifier "w_p_spell"
; ";"
if_statement (+31 nodes collapsed)
if_statement (+37 nodes collapsed)
if_statement (+358 nodes collapsed)
comment "// Get the word and its length."
comment "// Figure out if the word should be capitalised."
declaration (+28 nodes collapsed)
comment "// Make a copy of current line since autocommands may free t"...
declaration (+29 nodes collapsed)
expression_statement
assignment_expression
identifier "spell_suggest_timeout"
= "="
number_literal "5000"
; ";"
comment "// Get the list of suggestions. Limit to 'lines' - 2 or the"...
comment "// 'spellsuggest', whatever is smaller."
declaration
type_identifier "suginfo_T"
identifier "sug"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "limit"
= "="
call_expression
identifier "MIN"
argument_list
( "("
identifier "sps_limit"
, ","
binary_expression
identifier "Rows"
- "-"
number_literal "2"
) ")"
; ";"
expression_statement (+31 nodes collapsed)
declaration
primitive_type "int"
init_declarator
identifier "selected"
= "="
identifier "count"
; ";"
expression_statement
call_expression
identifier "msg_ext_set_kind"
argument_list
( "("
string_literal
" "\""
string_content "confirm"
" "\""
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "GA_EMPTY"
argument_list
( "("
pointer_expression
& "&"
field_expression
identifier "sug"
. "."
field_identifier "su_ga"
) ")"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "msg"
argument_list
( "("
call_expression
identifier "_"
argument_list
( "("
string_literal
" "\""
string_content "No suggestions"
" "\""
) ")"
, ","
number_literal "0"
) ")"
; ";"
} "}"
else_clause
else "else"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "count"
> ">"
number_literal "0"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "count"
> ">"
field_expression
field_expression
identifier "sug"
. "."
field_identifier "su_ga"
. "."
field_identifier "ga_len"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "smsg"
argument_list
( "("
number_literal "0"
, ","
call_expression
identifier "_"
argument_list
( "("
concatenated_string
string_literal
" "\""
string_content "Only %"
" "\""
identifier "PRId64"
string_literal
" "\""
string_content " suggestions"
" "\""
) ")"
, ","
cast_expression
( "("
type_descriptor
primitive_type "int64_t"
) ")"
field_expression
field_expression
identifier "sug"
. "."
field_identifier "su_ga"
. "."
field_identifier "ga_len"
) ")"
; ";"
} "}"
} "}"
else_clause (+718 nodes collapsed)
if_statement (+460 nodes collapsed)
expression_statement
call_expression
identifier "spell_find_cleanup"
argument_list
( "("
pointer_expression
& "&"
identifier "sug"
) ")"
; ";"
expression_statement
call_expression
identifier "xfree"
argument_list
( "("
identifier "line"
) ")"
; ";"
labeled_statement
statement_identifier "skip"
: ":"
expression_statement
assignment_expression
field_expression
identifier "curwin"
-> "->"
field_identifier "w_p_spell"
= "="
identifier "wo_spell_save"
; ";"
} "}"
comment "/// Find spell suggestions for \"word\". Return them in the g"...
comment "/// a list of allocated strings."
comment "///"
comment "/// @param maxcount maximum nr of suggestions"
comment "/// @param need_cap 'spellcapcheck' matched"
function_definition (+275 nodes collapsed)
comment "/// Find spell suggestions for the word at the start of \"bad"...
comment "/// Return the suggestions in \"su->su_ga\"."
comment "/// The maximum number of suggestions is \"maxcount\"."
comment "/// Note: does use info for the current window."
comment "/// This is based on the mechanisms of Aspell, but completel"...
comment "///"
comment "/// @param badlen length of bad word or 0 if unknown"
comment "/// @param banbadword don't include badword in suggestions"
comment "/// @param need_cap word should start with capital"
function_definition (+936 nodes collapsed)
comment "/// Find suggestions by evaluating expression \"expr\"."
function_definition (+234 nodes collapsed)
comment "/// Find suggestions in file \"fname\". Used for \"file:\" in '"...
function_definition (+369 nodes collapsed)
comment "/// Find suggestions for the internal method indicated by \"s"...
function_definition (+384 nodes collapsed)
comment "/// Free the info put in \"*su\" by spell_find_suggest()."
function_definition (+76 nodes collapsed)
comment "/// Try finding suggestions by recognizing specific situatio"...
function_definition (+214 nodes collapsed)
comment "// Measure how much time is spent in each state."
comment "// Output is dumped in \"suggestprof\"."
preproc_ifdef (+354 nodes collapsed)
comment "/// Try finding suggestions by adding/removing/swapping lett"...
function_definition (+269 nodes collapsed)
comment "// Check the maximum score, if we go over it we won't try th"...
preproc_function_def
#define "#define"
identifier "TRY_DEEPER"
preproc_params
( "("
identifier "su"
, ","
identifier "stack"
, ","
identifier "depth"
, ","
identifier "add"
) ")"
preproc_arg "((depth) < MAXWLEN - 1 && (stack)[depth].ts_score + (add) < "...
comment "/// Try finding suggestions by adding/removing/swapping lett"...
comment "///"
comment "/// This uses a state machine. At each node in the tree we "...
comment "/// operations. When trying if an operation works \"depth\" i"...
comment "/// stack[] is used to store info. This allows combinations"...
comment "/// character, replace one and delete another. The number o"...
comment "/// limited by su->su_maxscore."
comment "///"
comment "/// After implementing this I noticed an article by Kemal Of"...
comment "/// describes something similar: \"Error-tolerant Finite Stat"...
comment "/// Applications to Morphological Analysis and Spelling Corr"...
comment "/// The implementation in the article is simplified and requ"...
comment "/// unknown depth. The implementation here only needs a sta"...
comment "/// the length of the word."
comment "///"
comment "/// This is also used for the sound-folded word, \"soundfold\""...
comment "/// The mechanism is the same, but we find a match with a so"...
comment "/// that comes from one or more original words. Each of the"...
comment "/// added, this is done by add_sound_suggest()."
comment "/// Don't use:"
comment "/// the prefix tree or the keep-case tree"
comment "/// \"su->su_badlen\""
comment "/// anything to do with upper and lower case"
comment "/// anything to do with word or non-word characters (\"s"...
comment "/// banned words"
comment "/// word flags (rare, region, compounding)"
comment "/// word splitting for now"
comment "/// \"similar_chars()\""
comment "/// use \"slang->sl_repsal\" instead of \"lp->lp_replang->"...
function_definition (+9033 nodes collapsed)
comment "/// Go one level deeper in the tree."
function_definition (+117 nodes collapsed)
comment "/// \"fword\" is a good word with case folded. Find the match"...
comment "/// words and put it in \"kword\"."
comment "/// Theoretically there could be several keep-case words tha"...
comment "/// same case-folded word, but we only find one..."
function_definition (+850 nodes collapsed)
comment "/// Compute the sound-a-like score for suggestions in su->su"...
comment "/// su->su_sga."
function_definition (+330 nodes collapsed)
comment "/// Combine the list of suggestions in su->su_ga and su->su_"...
comment "/// They are entwined."
function_definition (+985 nodes collapsed)
comment "/// For the goodword in \"stp\" compute the soundalike score c"...
comment "/// badword."
comment "///"
comment "/// @param badsound sound-folded badword"
function_definition (+372 nodes collapsed)
comment "/// structure used to store soundfolded words that add_sound"...
comment "/// handled already."
type_definition (+22 nodes collapsed)
declaration
storage_class_specifier
static "static"
type_identifier "sftword_T"
identifier "dumsft"
; ";"
preproc_function_def
#define "#define"
identifier "HIKEY2SFT"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "((sftword_T *)((p) - (dumsft.sft_word - (uint8_t *)&dumsft))"...
preproc_function_def
#define "#define"
identifier "HI2SFT"
preproc_params
( "("
identifier "hi"
) ")"
preproc_arg "HIKEY2SFT((hi)->hi_key)"
comment "/// Prepare for calling suggest_try_soundalike()."
function_definition (+126 nodes collapsed)
comment "/// Find suggestions by comparing the word in a sound-a-like"...
comment "/// Note: This doesn't support postponed prefixes."
function_definition (+184 nodes collapsed)
comment "/// Finish up after calling suggest_try_soundalike()."
function_definition (+222 nodes collapsed)
comment "/// A match with a soundfolded word is found. Add the good "...
comment "/// produce this soundfolded word."
comment "///"
comment "/// @param score soundfold score"
function_definition (+1253 nodes collapsed)
comment "/// Find word \"word\" in fold-case tree for \"slang\" and retur"...
function_definition (+393 nodes collapsed)
comment "/// Returns true if \"c1\" and \"c2\" are similar characters acc"...
comment "/// lines in the .aff file."
function_definition (+307 nodes collapsed)
comment "/// Adds a suggestion to the list of suggestions."
comment "/// For a suggestion that is already in the list the lowest "...
comment "///"
comment "/// @param gap either su_ga or su_sga"
comment "/// @param badlenarg len of bad word replaced with \"goodwor"...
comment "/// @param had_bonus value for st_had_bonus"
comment "/// @param slang language for sound folding"
comment "/// @param maxsf su_maxscore applies to soundfold score, su"...
function_definition (+773 nodes collapsed)
comment "/// Suggestions may in fact be flagged as errors. Esp. for "...
comment "/// for split words, such as \"the the\". Remove these from t"...
comment "///"
comment "/// @param gap either su_ga or su_sga"
function_definition (+296 nodes collapsed)
comment "/// Add a word to be banned."
function_definition (+129 nodes collapsed)
comment "/// Recompute the score for all suggestions if sound-folding"...
comment "/// is slow, thus only done for the final results."
function_definition (+83 nodes collapsed)
comment "/// Recompute the score for one suggestion if sound-folding "...
function_definition (+214 nodes collapsed)
comment "/// Function given to qsort() to sort the suggestions on st_"...
comment "/// First on \"st_score\", then \"st_altscore\" then alphabetica"...
function_definition (+175 nodes collapsed)
comment "/// Cleanup the suggestions:"
comment "/// - Sort on score."
comment "/// - Remove words that won't be displayed."
comment "///"
comment "/// @param keep nr of suggestions to keep"
comment "///"
comment "/// @return the maximum score in the list or \"maxscore\" unm"...
function_definition (+193 nodes collapsed)
comment "/// Compute a score for two sound-a-like words."
comment "/// This permits up to two inserts/deletes/swaps/etc. to kee"...
comment "/// Instead of a generic loop we write out the code. That k"...
comment "/// avoiding checks that will not be possible."
comment "///"
comment "/// @param goodstart sound-folded good word"
comment "/// @param badstart sound-folded bad word"
function_definition (+1441 nodes collapsed)
comment "/// Compute the \"edit distance\" to turn \"badword\" into \"good"...
comment "/// deletes/inserts/substitutes/swaps are required the lower"...
comment "///"
comment "/// The algorithm is described by Du and Chang, 1992."
comment "/// The implementation of the algorithm comes from Aspell ed"...
comment "/// edit_distance(). It has been converted from C++ to C an"...
comment "/// support multi-byte characters."
function_definition (+838 nodes collapsed)
type_definition (+21 nodes collapsed)
comment "/// Like spell_edit_score(), but with a limit on the score t"...
comment "/// May return SCORE_MAXMAX when the score is higher than \"l"...
comment "///"
comment "/// This uses a stack for the edits still to be tried."
comment "/// The idea comes from Aspell leditdist.cpp. Rewritten in "...
comment "/// for multi-byte characters."
function_definition (+48 nodes collapsed)
comment "/// Multi-byte version of spell_edit_score_limit()."
comment "/// Keep it in sync with the above!"
function_definition (+960 nodes collapsed)