BEGIN{ 
	$inMethod = $inCapture = 0;
	 $capture = '';
}
 
 $inMethod = 1 and print STDERR "In method\n" if /protected TokenStream getTokenStream/;
 $inCapture = 0 if /^\s+\}\s*\r?\n/;
 $capture .= $_ if $inCapture;
 $inCapture = 1 and print STDERR "In capture\n" if /if/ and /stemsAllowed/;
 
if (/^\}/ and $inMethod) {
        $capture =~ s/^    //gm;
        $capture =~ s/\.tokenStream.+;//s;
        $capture =~ s/\bstopWordsAllowed\s*\?(.+)\:(.+)\;\s*\r?\n?/$1;/s;
        $capture =~ s/[\s\r\n]+$//;
 	print << "ALL";
 
    @Override public org.apache.lucene.analysis.Analyzer getGlossaryAnalyser() {
$capture;
    }
 	
ALL
 }
