#!/usr/bin/perl -w -s our ($ori,$ablt,$rblt) ; my ($bl); $bl = $ablt if (defined $ablt) && ($ablt =~ /[A-Za-z]+/); $bl = $rblt if (defined $rblt) && ($rblt =~ /[A-Za-z]+/); $/=''; my $s; while(<>){ chomp; if (/^\%baselang(?:uage)?\s+(\S+)/) { $bl ||= $1; while(m{\%(\S+)}g){ $direct{$1}++} } elsif(/^\%(\S+)/) { while(m{\%(\S+)}g){ $direct{$1}++} } elsif(/^#/) { } elsif(/^(\S.*)/) { my $t = $1; my $r = $'; while( m{\n(\S+)(?:[ \t]+)((?:.|\n[ \t])*)}g ){ my $def=$2; $rel{$1}++; print "Error: $1($t) is empty\n" unless $def =~ /\w/; }} else { print "Error: {$_}\n"} } for (sort keys %direct){ print "\%$_\t= $direct{$_}\n"; } for (sort keys %rel){ print "$_\t= $rel{$_}\n"; } __END__ =head1 NAME thesaurusV - Make thesaurus statistics =head1 SYNOPSIS thesaurusV file.the =head1 DESCRIPTION Calculates some statistics and simple validations Useful for debugging thesaurus... =head1 AUTHOR J.Joao Almeida, jj@di.uminho.pt =head1 SEE ALSO perl(1). =cut