title: How to use Stanford parser
body: <p>I downloaded the Stanford parser 2.0.5 and use Demo2.java source code that is in the package, but After I compile and run the program it has many errors. 
  A part of my program is:</p>
  
  <pre><code>public class testStanfordParser {
  /** Usage: ParserDemo2 [[grammar] textFile] */
    public static void main(String[] args) throws IOException {
      String grammar = args.length &gt; 0 ? args[0] : "edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz";
      String[] options = { "-maxLength", "80", "-retainTmpSubcategories" };
      LexicalizedParser lp = LexicalizedParser.loadModel(grammar, options);
      TreebankLanguagePack tlp = new PennTreebankLanguagePack();
      GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();
   ...
  </code></pre>
  
  <p>the errors are:</p>
  
  <pre><code>Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz java.io.IOException: Unable to resolve edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz" as either class path, filename or URL
  at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:408)
  at edu.stanford.nlp.io.IOUtils.readStreamFromString(IOUtils.java:356)
  at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromSerializedFile(LexicalizedParser.java:594)
  at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromFile(LexicalizedParser.java:389)
  at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:157)
  at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:143)
  at testStanfordParser.main(testStanfordParser.java:19).                                             Loading parser from text file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz Exception in thread "main" java.lang.NoSuchMethodError: edu.stanford.nlp.io.IOUtils.readerFromString(Ljava/lang/String;)Ljava/io/BufferedReader;
  at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromTextFile(LexicalizedParser.java:528)
  at edu.stanford.nlp.parser.lexparser.LexicalizedParser.getParserFromFile(LexicalizedParser.java:391)
  at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:157)
  at edu.stanford.nlp.parser.lexparser.LexicalizedParser.loadModel(LexicalizedParser.java:143)
  at testStanfordParser.main(testStanfordParser.java:19)
  </code></pre>
  
  <p>please help me to solve it.
  Thanks</p>