0

I'm try to get Stanford's Classifier running on Windows.

Working through the Sentiment Classifier:

https://nlp.stanford.edu/wiki/Software/Classifier/Sentiment

I've downloaded the dataset, and installed iconv, head, tail

http://gnuwin32.sourceforge.net/packages/coreutils.htm

And got Perl running from ActivePerl.

However, the Perl command given in the instructions doesn't work on Windows.

perl -ne 'print "neg\t" . $_' <  rt-polarity.neg.utf8 > rt-polarity.neg.utf8.tsv

Gives an error:

Can't find string terminator "'" anywhere before EOF at -e line 1.

Which I'm guessing is some difference in use of the apostrophe char between what Windows uses and Unix does.

What should I use in Windows to convert this file with Perl to .tsv?

bendecko
  • 2,643
  • 1
  • 23
  • 33
  • You are using a sh/bash command, but you aren't using `sh` or `bash`. Write commands for the shell you use, or use the shell for which you write your commands. – ikegami Sep 28 '17 at 19:06
  • It's unfortunate that this was marked as "an exact duplicate" without providing a link to that dupe. But, one of the interesting aspects of the DOS "shell" is that you usually have to reverse the quotes compared to UNIX. Try something like `perl -ne "print 'neg\t' . $_" < rt-polarity.neg.utf8 > rt-polarity.neg.utf8.tsv `. – jimtut Sep 29 '17 at 00:52

0 Answers0