#!/usr/local/bin/perl

use visual;
use jspell;
my $a;

while(<>){
  chop;
  $a= { NAME => $_,
        FLA  => [flags($_)],
        DER  => [der($_)],
        PRO  => [ map 
                  {pro2any($_)} 
                  (nlgrep($_,"/home/jj/public_html/pln/proverbio.dic")) 
                ] 
      };

  $a->{RAD}    = [rad($_)];
  $a->{JSPELL} = [fea($_)];

  #print any2str($a,2);
  page($a,$_,"analise dinamica");
}

sub pro2any {
  my ($pro,$tipo,$ori,$com,$prov) = split(":", $_[0]);
  if($tipo eq "adiv") { 
     +{ adivinha => $pro,
        solucao  => $com,
        FROM => $prov}
  }
  else {
     +{ 'provérbio' => $pro,
        FROM => $prov}
  }
};
