#!/usr/local/bin/perl 

local($line, $page);

$chapter = $ARGV[1];
open(MAINFILE, $ARGV[0]);
$line = 1;
while (<MAINFILE>){
	
	s/\\\'//g;
	@fields = split(/[\W]+/);	
	open(SFILE, "get_page.pl $chapter $line |");
	$page = <SFILE>;
	chop $page;
	close(SFILE);
	foreach $b (@fields){
		if (length($b) > 3){
		print "$chapter:$page:$line:$b\n";
		}
	} 
	$line++;
}
close(MAINFILE);
