mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 14:05:29 +03:00
3c07c5df4d
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1307 1f5c12ca-751b-0410-a591-d2e778427230
16 lines
396 B
Perl
Executable File
16 lines
396 B
Perl
Executable File
#!/usr/bin/perl -w
|
|
|
|
# $Id$
|
|
#lopar2pos: extract POSs from LOPAR output
|
|
#usage: lopar2pos.pl CORPUS.lopar > CORPUS.pos
|
|
|
|
my $infilename = shift @ARGV;
|
|
open(INFILE, "<$infilename") or die "couldn't open '$infilename' for read: $!\n";
|
|
while(my $line = <INFILE>)
|
|
{
|
|
my @words = split(/\s+/, $line);
|
|
my @tags = map {$_ =~ /^[^_]*_([A-Z]+)/; $1} @words;
|
|
print join(' ', @tags) . "\n";
|
|
}
|
|
close(INFILE);
|