#!/usr/bin/perl
use locale;
use POSIX qw(locale_h);
setlocale(LC_CTYPE, "pt_PT") or die;

@sistema=("Jspell2","LabEL_DC", "ReGra", "LabEL_DL", "Smorph", "PALMORF");
$min=800000;
$i=0;
while ($i lt 6) {

    $j=$i+1;

    while ($j lt 6) {

	$res=`concord.pl $sistema[$i] $sistema[$j]`;
	($comuns)=($res=~/Formas comuns([0-9]+)/);
	print " $sistema[$i] $sistema[$j] $comuns\n";
	$min=$comuns if ($comuns le $min);
	$max=$comuns if ($comuns gt $max);
	$j++;
    }
    $i++;
}
print "Max: $max\n;Min: $min\n";
