#!/usr/bin/env perl use Lingua::Jspell; my $dic = new Lingua::Jspell("port"); while (<>){ if (/[<,.!;:]/) { print; } else { chomp; my $a = "$_\t|".join("|",$dic->rad($_))."|\t|".cats($dic,$_)."|\n"; $a =~ s/\|\|/|/g; print $a; } } sub cats { my ($dic, $a) = @_; my @l = map {"$_->{CAT}$_->{T}$_->{G}$_->{N}"} ($dic->fea($a)); my %l ; @l{@l} = @l; join("|", keys(%l)) } __END__ =head1 NAME addradical - adds (portuguese) lemma and pos information =head1 SYNOPSIS addradical file* =head1 DESCRIPTION Input should be one token perl line in CQP-like format, Output is sent to stdout. =head1 AUTHOR J.Joao Almeida, jj@di.uminho.pt =head1 SEE ALSO perl(1). jspell(1). =cut