hi to all,
I've got a list of tagged words, like this one (only a little bit
longest):
<tLn nr=11>
e CON e
le DET:def il
ha VER:pres avere|riavere
detto VER:pper dire
< NOM <unknown>
CORR VER:infi corre
> NOM <unknown>
e CON e
a PRE a
I need to transform the list below in (in which the CORR tag isn't
tagged):
<tLn nr=11>
e CON e
le DET:def il
ha VER:pres avere|riavere
detto VER:pper dire
<CORR>
e CON e
a PRE a
So I tried to write this awful script:
#!/usr/bin/perl -w
use strict;
$^I = '';
my $tic = 0;
my $toc = 0;
while(<>)
{
if(/^< NOM <unknown>.*/i)
{
$tic = 1;
next;
}
next if /^> NOM <unknown>.*/i;
next if $toc == 1;
$toc = 0;
if($tic==1)
{
s/^(\/?\w+).+/$1/gi;
chomp();
$_ = "<$_>";
$toc = 1;
$tic = 0;
}
s/<>//g;
print;
}
it doesn't return errors, but it stop printing the output after the
first correction. Someone can explain me why and eventually suggest how
to correct the corrector?
Thanks at all,
alladr
PS: another strange thing: if I declare at the beginning of the script:
my($tic,$toc); it returns me an error...
|^|_|^|_|^| |^|_|^|_|^|
| | | |
| | | |
| |*\_/*\_/*\_/*\_/*\_/* | |
| |
| |
| |
| http://www.e-allora.net |
| |
| |
**************************************
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>