summaryrefslogtreecommitdiff
path: root/corpus/conll2cdec.pl
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-10-25 15:01:49 -0400
committerChris Dyer <redpony@gmail.com>2014-10-25 15:01:49 -0400
commit2a6a16056d0705423c40366dcde7dd46e39be248 (patch)
tree59adccd5a4a729faef54cac266d9bff67584d07a /corpus/conll2cdec.pl
parent7547aef823c9f41edf363af8c3dd23992ead6c68 (diff)
bit more info
Diffstat (limited to 'corpus/conll2cdec.pl')
-rwxr-xr-xcorpus/conll2cdec.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/corpus/conll2cdec.pl b/corpus/conll2cdec.pl
index f65b86f8..ee4e07db 100755
--- a/corpus/conll2cdec.pl
+++ b/corpus/conll2cdec.pl
@@ -1,12 +1,15 @@
#!/usr/bin/perl -w
use strict;
+die "Usage: $0 file.conll\n\n Converts a CoNLL formatted labeled sequence into cdec's format.\n\n" unless scalar @ARGV == 1;
+open F, "<$ARGV[0]" or die "Can't read $ARGV[0]: $!\n";
+
my @xx;
my @yy;
my @os;
my $sec = undef;
my $i = 0;
-while(<>) {
+while(<F>) {
chomp;
if (/^\s*$/) {
print "<seg id=\"$i\"";