chiark / gitweb /
Decrement $. when making concordance
authorMatthew Vernon <matthew@debian.org>
Sat, 21 Aug 2021 12:55:25 +0000 (13:55 +0100)
committerMatthew Vernon <matthew@debian.org>
Sat, 21 Aug 2021 12:55:25 +0000 (13:55 +0100)
The previous fix to using the rawtext file (rather than the output of
bible) correctly discarded the header line. It didn't, however, adjust
$. (line count), which is used to build the concordance. So we need to
store $. -1 in the concordance.

Thanks to Christian Weisgerber <naddy@mips.inka.de> for the report.

makeconc.pl

index cf3edebca39107112170f10f710d39902c504b07..6ccc32d4392b0e35253e2ce3ee934722b3828b6a 100755 (executable)
@@ -52,7 +52,8 @@ while (<BIBLE>) {
        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);
     }
 }
 die $! if BIBLE->error();