0

I am extremely new to coding including using Eclipse.

Can someone please explain, with examples of code, how to execute ClearNLP functions: Tokenizer and sentence segmenter; Part-of-speech tagger; Dependency parser; Semantic role labeller in Eclipse.

I have already downloaded the .jar files and imported them onto Eclipse:

package test;

import com.clearnlp.run.Version;

public class TestClearNLP {

    public static void main(String[] args){
        Version.main(args);
    }

}

When run, this creates output in the console of:

ClearNLP version 2.0.2
Webpage: clearnlp.com
Owner  : Jinho D. Choi
Contact: support@clearnlp.com

This all matches the installation instructions on the ClearNLP website

Now I need to know how to execute each function on Eclipse.

An example, for the Tokenizer you need to execute the code:

java com.clearnlp.run.Tokenizer -i <filepath> [-ie <regex> -oe <string> -if <string> -of <string> -l <language> -twit]

 -i <filepath>   : input path (required)
 -ie <regex>     : input file extension (default: .*)
 -oe <string>    : output file extension (default: tok)
 -if <string>    : input format (default: raw)
 -of <string>    : input format (default: line)
 -l <language>   : language (default: en)
 -twit <boolean> : if set, do not tokenize special punctuation used in twitter

How can I transfer the code so it is able to be run on Eclipse?

braX
  • 11,506
  • 5
  • 20
  • 33
AmyChodorowski
  • 392
  • 2
  • 14
  • 2
    Have you looked at the demo code? https://github.com/clearnlp/clearnlp-demo/tree/master/src/main/java/com/clearnlp/demo – DavidPostill Jul 23 '14 at 10:43
  • 1
    [How To Use Command Line Arguments in Eclipse](http://www.cs.colostate.edu/helpdocs/eclipseCommLineArgs.html) and [Eclipse : how we take arguments for main when run](http://stackoverflow.com/questions/12222153/eclipse-how-we-take-arguments-for-main-when-run) – DavidPostill Jul 26 '14 at 07:13
  • Chod, did you figure it out? – Daniil Shevelev Sep 26 '14 at 20:23
  • Can I ask why you need to execute the functions inside of eclipse? You can execute all of these functions directly from the command line, the website and the original googlecode sites give very clear, detailed instructions on how to run the various tools right on the command line. –  Feb 17 '15 at 23:55

0 Answers0