Naproawiono dgc - teraz obsluguje tez komenatrze w linii z regula.

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@34 e293616e-ec6a-49c2-aa92-f4a8b91c5d16
This commit is contained in:
pawelk 2008-04-30 10:16:33 +00:00
parent 19dfa5cb76
commit 12d8443b2c

View File

@ -130,27 +130,30 @@ else {
while(<INPUT>) while(<INPUT>)
{ {
if(/^\s*AGR\s+(\S+)\s+(\S+)\s*$/) s/#.*//;
s/^\s+//;
s/\s+$//;
if(/^AGR\s+(\S+)\s+(\S+)$/)
{ {
push @{$agr{$1}}, $2; push @{$agr{$1}}, $2;
} }
elsif(/^\s*GOV\s+(\S+)\s+(\S+)\s*$/) elsif(/^GOV\s+(\S+)\s+(\S+)$/)
{ {
push @{$gov{$1}}, attr::parse($2); push @{$gov{$1}}, attr::parse($2);
} }
elsif(/^\s*ROLE\s+\S+\s*$/) elsif(/^ROLE\s+\S+$/)
{ {
$roles{$_}=1; $roles{$_}=1;
print OUTPUT; print OUTPUT "$_\n";
} }
elsif(/^\s*SGL\s+\S+\s*$/) elsif(/^SGL\s+\S+$/)
{ {
++$nsgl; ++$nsgl;
print OUTPUT; print OUTPUT "$_\n";
} }
elsif(/^\s*REQ\s+(\S+)\s+(\S+)\s*$/) elsif(/^REQ\s+(\S+)\s+(\S+)$/)
{ {
print OUTPUT "#$_"; print OUTPUT "#$_\n";
my $cat = attr::parse $1; my $cat = attr::parse $1;
for my $atomcat (keys %cats) for my $atomcat (keys %cats)
{ {
@ -161,19 +164,19 @@ while(<INPUT>)
} }
} }
} }
elsif(/^\s*LEFT\s+\S+\s*$/) elsif(/^LEFT\s+\S+$/)
{ {
++$nleft; ++$nleft;
print OUTPUT; print OUTPUT "$_\n";
} }
elsif(/^\s*RIGHT\s+\S+\s*$/) elsif(/^RIGHT\s+\S+$/)
{ {
++$nright; ++$nright;
print OUTPUT; print OUTPUT "$_\n";
} }
elsif(my ($hs,$ds,$r) = /^\s*LINK\s+($cats_re)\s+($cats_re)\s+(\S+)\s*$/) elsif(my ($hs,$ds,$r) = /^LINK\s+($cats_re)\s+($cats_re)\s+(\S+)$/)
{ {
print OUTPUT "#$_"; print OUTPUT "#$_\n";
for my $h ($hs =~ /$attr::cat_re/g) for my $h ($hs =~ /$attr::cat_re/g)
{ {
for my $d ($ds =~ /$attr::cat_re/g) for my $d ($ds =~ /$attr::cat_re/g)
@ -182,10 +185,12 @@ while(<INPUT>)
} }
} }
} }
elsif(/^$/) {
else # pomijamy puste linie oraz komentarze
}
else
{ {
print OUTPUT; print STDERR "Illegal format: $_\n";
} }
} }