[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

This is an old revision of the document!


Manual

How to use the Interset

You can write your own tag conversion Perl script, and use the Interset driver library. You have to tell Perl where to find the drivers:

setenv PERLLIB /home/zeman/lib/perl:$PERLLIB

Once the variable is set, writing a conversion script is very easy. For instance, my csts-cs-pdt-en-penn.pl script (meaning “read and write CSTS format, read Czech PDT tags, write English Penn tags) essentially looks like this:

use tagset::cs::pdt;
use tagset::en::penn;
 
while(<>)
{
    if(s/<t>([^<]+)/<_tag_to_convert_>)
    {
        my $tag0 = $1;
        my $features = tagset::cs::pdt::decode($tag0);
        my $tag1 = tagset::en::penn::encode($features);
        s/<_tag_to_convert_>/<t>$tag1/;
    }
    print;
}

Note the two-step replacement of the original tag. I do not dare to use the original tag in a regular expression because there could be special characters in the tag.


[ Back to the navigation ] [ Back to the content ]