title: Extract Nouns from Text (Java)
body: <p>Does anyone know the easiest way to extract only nouns from a body of text?</p>
  
  <p>I've heard about the <a href="http://www.ims.uni-stuttgart.de/projekte/corplex/TreeTagger/" rel="noreferrer">TreeTagger tool</a> and I tried giving it a shot but couldn't get it to work for some reason.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks Phil</p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre> import org.annolab.tt4j.*; 
  TreeTaggerWrapper tt = new TreeTaggerWrapper(); 
  
  try { tt.setModel("/Nouns/english.par"); 
  
  tt.setHandler(new TokenHandler() { 
       void token(String token, String pos, String lemma) {    
       System.out.println(token+"\t"+pos+"\t"+lemma); } }); 
       tt.process(words); // words = list of words 
  
       } finally { tt.destroy(); 
  } </pre> 
  
  <p>That is my code, English is the language. I was getting the error : The type new TokenHandler(){} must implement the inherited abstract method TokenHandler.token. Am I doing something wrong?</p>