From 638f0092899809c48b8ebc09930c5866f99a3d92 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 28 May 2023 18:42:38 +1200 Subject: [PATCH] update word limit --- linesplit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linesplit.php b/linesplit.php index ce78938..9c6dd3a 100755 --- a/linesplit.php +++ b/linesplit.php @@ -3,6 +3,8 @@ error_reporting(E_ALL); +define('MAX_CHARACTERS', 2950); // reduced from previous 5000 + // Split at double-NL to only split at srt boundaries $lines = explode("\n\n", file_get_contents($_SERVER['argv'][1])); @@ -50,7 +52,7 @@ do { $line = $lines[$nextline++]; $linewords = strlen($line); // characters - if ($linewords + $buffwords > 5000) { + if ($linewords + $buffwords > MAX_CHARACTERS) { // flush buffer before adding flushwords($nextbuffer); $nextbuffer = '';