Add a limit for text analysis

This commit is contained in:
Eike Kettner
2020-03-27 22:54:49 +01:00
parent 14a25fe23e
commit 6a1297fc95
7 changed files with 137 additions and 45 deletions

View File

@ -78,6 +78,9 @@ let
};
};
};
text-analysis = {
max-length = 10000;
};
convert = {
chunk-size = 524288;
max-image-size = 14000000;
@ -530,6 +533,29 @@ in {
'';
};
text-analysis = mkOption {
type = types.submodule({
options = {
max-length = mkOption {
type = types.int;
default = defaults.text-analysis.max-length;
description = ''
Maximum length of text to be analysed.
All text to analyse must fit into RAM. A large document may take
too much heap. Also, most important information is at the
beginning of a document, so in most cases the first two pages
should suffice. Default is 10000, which are about 2-3 pages
(a rough guess).
'';
};
};
});
default = defaults.text-analysis;
description = "Settings for text analysis";
};
convert = mkOption {
type = types.submodule({
options = {