From 1be84beac2e1570db1d347c160092bfd65338263 Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Mon, 19 Jul 2021 12:08:42 +0100 Subject: [PATCH] Use the rawtext file to build concordance rather than running Bible chroots and similar systems don't have bible installed (natch), so will end up generating a 0-word concordance. We have the rawtext file available, so just use that instead. --- makeconc.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/makeconc.pl b/makeconc.pl index 97a388d..c3e5bb8 100755 --- a/makeconc.pl +++ b/makeconc.pl @@ -18,6 +18,7 @@ # Received from Chris Eich, replaces "makeconcordance" script. # Made use of stopwords conditional. ############################################################################### +use IO::Handle # Putting . on PATH ensures that the bible program will be found. $ENV{'PATH'} =~ s/^:*/.:/; @@ -40,7 +41,8 @@ if (open(STOP, "$ARGV[0]")) { # Generate plain text file, one "record" (e.g. bible verse) per line. # Fill %lines and $count tables, which are keyed by words. -open(BIBLE, "$PROG -f gen1:1-rev99:99 |"); +open(BIBLE, "bible.rawtext"); +; #discard the header line while () { s/^\S+\s+//; # Cut off the record reference that starts each line. tr/A-Z/a-z/; # Downcase. @@ -53,7 +55,7 @@ while () { $lines{$word} .= " " . $.; } } -close(BIBLE); +BIBLE->error(); # Create raw concordance, listing the lines where each word occurs. -- 2.30.2