Examples of DependencyParser


Examples of com.tuenti.supernanny.dependencies.DependencyParser

  }

  private void doResolve(CliParser p) throws IOException {
    // fetch needed deps
    System.out.println("Init repos");
    DependencyParser dparser = new SNDependencyParser(ReqType.SW, util);
    List<Requirement> reqs = null;
    try {
      reqs = dparser.parseMultipleDepFiles(p);
    } catch (FileNotFoundException e) {
      System.err.println("Dep file not found, sure this is a supernanny repo?");
      System.exit(1);
    } catch (InvalidFormatException e) {
      System.err.println("Invalid format" + e);
      System.exit(1);
    }

    DependencyParser defaultParser = new SNDependencyParser(ReqType.GE, util);
    repoProvider.setDependencyParser(defaultParser);

    // init all known repos in parallel to speed things up
    try {
      repoProvider.warmUp(reqs, executor);
View Full Code Here

Examples of edu.stanford.nlp.parser.nndep.DependencyParser

    }

    String text = "I can almost always tell when movies use fake dinosaurs.";

    MaxentTagger tagger = new MaxentTagger(taggerPath);
    DependencyParser parser = DependencyParser.loadFromModelFile(modelPath);

    DocumentPreprocessor tokenizer = new DocumentPreprocessor(new StringReader(text));
    for (List<HasWord> sentence : tokenizer) {
      List<TaggedWord> tagged = tagger.tagSentence(sentence);
      GrammaticalStructure gs = parser.predict(tagged);

      // Print typed dependencies
      System.err.println(gs);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.