twitter4j - Tree Tagger for Java (tt4j) -


i creating twitter sentiment analysis tool in java. using twitter4j api search tweets via hashtag feature in twitter , provide sentiment analysis on these tweets. through research, have found best solution doing using pos , treetagger java.

at moment, using examples provided see how code works, although encountering problems.

this code

import org.annolab.tt4j.*; import static java.util.arrays.aslist;  public class example {     public static void main(string[] args) throws exception {             // point tt4j treetagger installation directory. executable expected             // in "bin" subdirectory - in example @ "/opt/treetagger/bin/tree-tagger"             system.setproperty("treetagger.home", "/opt/treetagger");             treetaggerwrapper tt = new treetaggerwrapper<string>();             try {                     tt.setmodel("/opt/treetagger/models/english.par:iso8859-1");                     tt.sethandler(new tokenhandler<string>() {                             public void token(string token, string pos, string lemma) {                                     system.out.println(token + "\t" + pos + "\t" + lemma);                             }                     });                     tt.process(aslist(new string[] { "this", "is", "a", "test", "." }));             }             {                     tt.destroy();             }     } 

}

at moment, when run, receive error says

treetaggerwrapper cannot resolved type
tokenhandler cannot resolved type

i grateful given

thank you


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -