perl

# .................................................. get GRAMMAR of each word
&grammar($words[$i]);
print "<td valign=top><B>".$words[$i]."</B><BR>\n";
print "<BR>".$results[$i] if defined $results[$i];
print "\n</td>";

# ...................................................... PARSE it

# isolate sure things marked 5, put in optimal:
if ($results[$i] =~ m/5/){
my @these = split /:/, $results[$i]; # which result has the 5?
foreach my $x (@these){
chomp($x);
if($x =~ m/\s5/){$optimal[$i] = $x;}
}
} # end if

# isolate likely marked 4, put in optimal:
if ($results[$i] !~ m/5/){
my @these = split /:/, $results[$i];
foreach my $x (@these){
chomp($x);
if($x =~ m/\s4/){$optimal[$i] = $x; last;}
} # end foreach
} # end if
# subroutine to check ADJ N, if no N, then ADJ = N e.g "we gardena"


# check for modal plus infinitive
if ($results[$i] =~ /MODAL/){$HAVE_VP = 1;}
if ($HAVE_VP){ &modal_inf($results[$i]);}

# check for prepositions NB PRPs are 5's, so already in optimal
if ($optimal[$i] =~ /PRP/){
$HAVE_PP = 1; # set the flag
}

if ($HAVE_PP){
if($optimal[$i] =~ m/PRP ACCDAT 5/){$inflection = "DAT";}
if($optimal[$i] =~ m/PRP ACC 5/){$inflection = "ACC";}
&prep_phrase();
} # end if

# check for Noun Phrase (ADJ + N) then (PRN ADJ N)
if ($results[$i] =~ /^N\s/){$HAVE_N = 1;}
if ($HAVE_N){ &n_adj($results[$i]);}

$i++;

 

What to look for?