chiark / gitweb /
Use the rawtext file to build concordance rather than running Bible
[bible-kjv.git] / makeconc.pl
index 97a388db6525766294c7d70633176ed2aa1e2937..c3e5bb810c3c4cf7145ff40f18a39fa88688b245 100755 (executable)
@@ -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");
+<BIBLE>; #discard the header line
 while (<BIBLE>) {
     s/^\S+\s+//;       # Cut off the record reference that starts each line.
     tr/A-Z/a-z/;       # Downcase.
@@ -53,7 +55,7 @@ while (<BIBLE>) {
        $lines{$word} .= " " . $.;
     }
 }
-close(BIBLE);
+BIBLE->error();
 
 # Create raw concordance, listing the lines where each word occurs.