Treetagger koRpus package error

772 views Asked by At

I am trying to use the Treetag function in the koRpus package. The code I have used is

tagged.text <-treetag("C:/Rec_By_Others.txt",treetagger="manual",lang="en",TT.options=list(path="C:\\Program Files\\TreeTagger", preset="en"))

But I keep encountering with the following error.

Error in matrix(unlist(strsplit(tagged.text, "\t")), ncol = 3, byrow = TRUE,  : 
  'data' must be of a vector type, was 'NULL'

What do I do ?

1

There are 1 answers

0
K9K9 On

Your code seems correct to me, but I had the same error message. I could not find any solution for this problem until today. I finally found that I had a problem with the PERL installation, so I reinstalled a new version of PERL. Then, I checked if TreeTagger worked properly by applying the README TreeTagger instruction, that is:

Installation

  1. Install a Perl interpreter (if you have not already installed one). You can download a Perl interpreter for Windows for free at http://www.activestate.com/activeperl/
  2. Extract the zip file (if it was not extracted yet) and move the TreeTagger directory to the root directory of drive C:.
  3. Download the parameter files for the languages you need, decompress them (e.g. using Winzip or 7zip) and move them to the subdirectory TreeTagger/lib. Rename the parameter files to -utf8.par Example: Rename french-par-linux-3.2-utf8.bin to french-utf8.par Non-UTF8 parameter files are not supported anymore.
  4. Add the path C:\TreeTagger\bin to the PATH environment variable. The necessary steps differ from one Windows version to the other.
  5. Open a command prompt window and type the command set PATH=C:\TreeTagger\bin;%PATH%
  6. Go to the directory C:\TreeTagger cd c:\TreeTagger
  7. Now you can test the tagger, e.g. by analyzing this file with the command tag-english INSTALL.txt If you install the TreeTagger in a different directory, you have to modify the first path in the batch files tag-*.bat using an editor such as Wordpad.

Note also that: if you install the TreeTagger in a different directory, you have to modify the first path in the batch files tag-.bat using an editor such as Wordpad.

I hope this help.