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
commit328f3808a62975d5bdc2d1bc56f0e4867364fe7a (patch)
tree671125da7a6ec96fe059aab1ecef650e1ea6d738 /corpus/conll2cdec.pl
parente02b6af6b7cd8b224b1082123df8969532f4ce07 (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\"";