feat: add default boolean options for text plugin statistics
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -48,10 +48,20 @@ impl TextMetaPlugin {
|
|||||||
outputs,
|
outputs,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Set default text_detect_size option if not provided
|
// Set default options if not provided
|
||||||
if !base.options.contains_key("text_detect_size") {
|
let default_options = vec![
|
||||||
base.options.insert("text_detect_size".to_string(),
|
("text_detect_size", serde_yaml::Value::Number(PIPESIZE.into())),
|
||||||
serde_yaml::Value::Number(PIPESIZE.into()));
|
("text_word_count", serde_yaml::Value::Bool(true)),
|
||||||
|
("text_line_count", serde_yaml::Value::Bool(true)),
|
||||||
|
("text_line_max_len", serde_yaml::Value::Bool(true)),
|
||||||
|
("text_line_mean_len", serde_yaml::Value::Bool(true)),
|
||||||
|
("text_line_median_len", serde_yaml::Value::Bool(false)),
|
||||||
|
];
|
||||||
|
|
||||||
|
for (key, value) in default_options {
|
||||||
|
if !base.options.contains_key(key) {
|
||||||
|
base.options.insert(key.to_string(), value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get text_detect_size (previously max_buffer_size)
|
// Get text_detect_size (previously max_buffer_size)
|
||||||
|
|||||||
Reference in New Issue
Block a user