Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable the use of cost cutoffs in the English dict. #1455

Merged
merged 1 commit into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions data/en/4.0.dialect
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,24 @@
% sense in a headline context, it can, and will generate bad
% parses when applied to non-headline contexts. By making
% determiners optional, many other rules are thrown off.
%
% Dialects can be disabled by setting the cost to any large value,
% as long as it is greater than the `max-disjunct-cost` setting in
% the dictionary.

[default]
no-headline
bad-spelling: 0
colloquial: 0

[no-headline]
headline: 4
headline: 99

[headline]
headline: 0

[no-bad-spelling]
bad-spelling: 4
bad-spelling: 99

% Examples.
%[irish1] %this is a test
Expand Down
6 changes: 4 additions & 2 deletions data/en/4.0.dict
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
#define dictionary-locale en_US.UTF-8;

% The default largest disjunct cost to consider during parsing.
#define max-disjunct-cost 2.7;
#define panic-max-disjunct-cost 4.0;
% Setting this to 5 or larger effectively disables the use of cost
% cutoffs, as nothing in this dict can go this high.
#define max-disjunct-cost 10.0;
#define panic-max-disjunct-cost 10.0;

% _ORGANIZATION OF THE DICTIONARY_
%
Expand Down
6 changes: 4 additions & 2 deletions data/en/4.0.dict.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ changecom(`%')
#define dictionary-locale en_US.UTF-8;

% The default largest disjunct cost to consider during parsing.
#define max-disjunct-cost 2.7;
#define panic-max-disjunct-cost 4.0;
% Setting this to 5 or larger effectively disables the use of cost
% cutoffs, as nothing in this dict can go this high.
#define max-disjunct-cost 10.0;
#define panic-max-disjunct-cost 10.0;

% _ORGANIZATION OF THE DICTIONARY_
%
Expand Down