antoine-source/appleworksgs/Spell/Inc/SCPARAM.H
2023-03-04 03:45:20 +01:00

1 line
3.2 KiB
C
Executable File

/***********************************************************************\
Filename: scparam.h
\***********************************************************************/
#ifndef SC_SCPARAM
#define SC_SCPARAM
/*****************************************************************************
SPELLING COMPONENTS ADJUSTABLE PARAMETERS
*****************************************************************************/
/* LISTALTS is the maximum number of correction candidates that will be
stored in Correct's ranked list. Decreasing this saves memory and speeds
up correction slightly but decreases the number of correction candidates
that could be returned. The following table indicates the effect of
LISTALTS: the percentages are relative to LISTALTS = 16. For example, if
Correct does find a valid correction candidate when LISTALTS is 16 then
it will find the correction candidate 96.87 percent of the time when
LISTALTS is 4.
1 80.64% 5 97.86% 9 99.42% 13 99.85%
2 90.87% 6 98.44% 10 99.59% 14 99.91%
3 95.03% 7 98.86% 11 99.72% 15 99.96%
4 96.87% 8 99.15% 12 99.77% 16 100.00%
Note that this table implies that you had better make LISTALTS at least
two, and better four, but more than 8 is likely a waste of resources.
[ Bullshit. Making the table a few elements bigger is hardly wasting
resources. What they mean is there's not much point to using more
than 8. But since this is dynamic now anyway, and the size is passed,
this is irrelevant. --RAH ]
This table was generated from over 29,000 corrections either generated in
our in-house spelling checker or in published misspelling lists. */
extern unsigned _SPListAlts;
#ifndef MAXLISTALTS
#define MAXLISTALTS 16
#endif
/* This is the maximum number of entries that can be added to the
Searchpath. Making this smaller saves some space but limits the number
of word lists that can be opened at one time. */
#ifndef SRCHMAXSIZE
#define SRCHMAXSIZE 10
#endif
/* This is the maximum difference between the query length and the length of
the longest common subsequence of it with a correction result. The
larger this number, the more corrections may diverge from the query.
Making it zero would require that every letter in the query also be
present in the correction candidate; this is not recommended. Three
is the suggested minimum.
*/
#ifndef QLENTHRESH
#define QLENTHRESH 4
#endif
/* Corrfinish determines the closest (by seqlen() measure) element of the
ranked list. It then eliminates candidates which are further by
QDIFTHRESH from the query than this closest element. The value here is
the minimum recommended value. */
#ifndef QDIFTHRESH
#define QDIFTHRESH 2
#endif
/* This table describes the relationship between these two pruning
parameters and the ranked list size.
QLENTHRESH QDIFTHRESH rlsize % found
3 1 5.7 92.74
3 2 9.5 94.03
3 99 10.5 ?
4 2 9.9 94.32
4 99 13.0 ?
99 99 15.1 94.49
*/
#endif