note
hdb
<p>
I pressed the wrong button and shrunk the code accidentially. It still should do what you want.
</p>
<code>
use strict;
use warnings;
print "<text>",join(" ",map{/^(\w+).*?(B-NP|I-NP)?$/;
$a.="<annotation><type>NP</type><text>$1</text></annotation>\n"if$2;$1}<DATA>),"<text>\n$a";
__DATA__
how B-NP
are
you I-NP
really
</code>
1046069
1046094