TreeTagger for Java (TT4J)

TreeTagger for Java is a Java wrapper around the popular TreeTagger package by Helmut Schmid. It was written with a focus on platform-independence and easy integration into applications. It is written in Java 5 and has been tested on OS X (10.4 and 10.5), Ubuntu Linux and Windows.

Simple illustration of how to use TT4J

 TreeTaggerWrapper tt = new TreeTaggerWrapper<String>();
 try {
     tt.setModel("/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(Arrays.asList(new String[] {"This", "is", "a", "test", "."}));
 }
 finally {
     tt.destroy();
 }

License

The TreeTagger package, which is wrapped by TT4J, may only be used according to the TreeTagger license terms. TreeTagger for Java itself is provided under the Lesser Gnu Public License (LGPL) without any warranty.