From 1595ac2b2c8bed82f4acbfcb11ccd7975863b5b3 Mon Sep 17 00:00:00 2001 From: Rose Liverman Date: Sat, 22 Aug 2026 22:43:11 -0600 Subject: [PATCH] fix count_characters.lua to use config if its present --- count_characters.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/count_characters.lua b/count_characters.lua index dd88908..774dcb7 100755 --- a/count_characters.lua +++ b/count_characters.lua @@ -3,7 +3,9 @@ package.path = (arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)")) .. "lib" .. package.config:sub(1, 1) .. "?.lua;" .. package.path local utility = require "utility" -local maximum_bytes = 40000 +local config = utility.get_config("read-only") +if not config.llm_covers then config.llm_covers = {} end +if not config.llm_covers.maximum_bytes then config.llm_covers.maximum_bytes = 40000 end local read_all = function(file_name) return utility.open(file_name, "r", function(file) @@ -25,7 +27,7 @@ for _, path in ipairs{ ".", "extracted_texts", } do local path, name, extension = utility.split_path_components(file_name) local text = read_all(file_name) - print(math.floor(#text/maximum_bytes + 1), math.floor(#text/1000) .. "k", name) + print(math.floor(#text/config.llm_covers.maximum_bytes + 1), math.floor(#text/1000) .. "k", name) end) print("Press enter.") io.read("*line")