Comment utiliser le Stanford parser

J'ai téléchargé le Stanford parser 2.0.5 et l'utilisation Demo2.java le code source est dans le paquet, mais Après je l'ai compiler et d'exécuter le programme, il a de nombreuses erreurs.
Une partie de mon programme est:

public class testStanfordParser {
/** Usage: ParserDemo2 [[grammar] textFile] */
  public static void main(String[] args) throws IOException {
    String grammar = args.length > 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();
 ...

les erreurs sont:

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)

merci de m'aider à le résoudre.
Grâce

J'ai résolu ce problème. Le problème était le conflit entre le stanford parser paquet et stanford coreNLP paquet dans mon espace de travail.
Jetez un oeil à cette question [enter description du lien ici][1] [1]: stackoverflow.com/questions/24084556/...
pouvez-vous expliquer ce qu'est exactement que vous avez fait pour résoudre ce problème?
J'ai ajouté de façon erronée à la fois de Stanford parser paquet et Stanford CoreNLP paquet à mon projet. après avoir retiré le Stanford parser, le problème a été résolu.

OriginalL'auteur SahelSoft | 2013-05-13