# 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/^:*/.:/;
# 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.
next if $stopword{$word};
$count{$word}++; # Move below next line to count per-line.
next if $seenonthisline{$word}++;
- $lines{$word} .= " " . $.;
+ #the header line discard still leaves $. 1 higher than we want
+ $lines{$word} .= " " . ($. - 1);
}
}
-close(BIBLE);
+die $! if BIBLE->error();
# Create raw concordance, listing the lines where each word occurs.