Package opennlp.tools.parser

Examples of opennlp.tools.parser.Parse.show()


 
   parse = converter.transformParseFromTagger(parse);
  
   if (mLogger.isLoggable(Level.INFO)) {
     StringBuffer parseString = new StringBuffer();
     parse.show(parseString);
    
     mLogger.log(Level.INFO, parseString.toString());
   }
  
   createAnnotation(cas, sentenceAnnotation.getBegin(), parse);
View Full Code Here


        if (start != -1) {
          names.add(new Span(start,tokens.length-1));
        }
        addNames(tags[fi],names,tokens);
      }
      p.show();
    }
  }
     
  /**
   * Adds sgml style name tags to the specified input buffer and outputs this information to stdout.
View Full Code Here

    String sent = jcas.getDocumentText();
    StringBuffer buff = new StringBuffer();
    Parse parse = null;
    try{
      parse = ParserTool.parseLine(sent, parser, 1)[0];
      parse.show(buff);
    }catch(NullPointerException e){
      System.err.println("Parser error... no parse found... check POS tags of missed sentence (immediately above)");
    }
    if(parse == null){
      buff.append("(S null)");
View Full Code Here

      }
     
      for (int fi = 0, fl = finders.length; fi < fl; fi++) {
        Parse.addNames(tags[fi],nameSpans[fi],tagNodes);
      }
      p.show();
    }
  }
     
  /**
   * Adds sgml style name tags to the specified input buffer and outputs this information to stdout.
View Full Code Here

     
      parse = converter.transformParseFromTagger(parse);
  
      if (mLogger.isLoggable(Level.INFO)) {
        StringBuffer parseString = new StringBuffer();
        parse.show(parseString);
    
        mLogger.log(Level.INFO, parseString.toString());
      }
  
      createAnnotation(cas, sentenceAnnotation.getBegin(), parse);
View Full Code Here

//        System.out.println
        normalizers.put(node1Str, norm);
        normalHits++;
      }
      nodeStr = new StringBuffer();
      node2.show(nodeStr);
      String node2Str = nodeStr.toString();
      if(!normalizers.containsKey(node2Str)){
        double norm = sim(node2, node2);
        normalizers.put(node2Str, norm);
        normalHits++;
View Full Code Here

    String sent = jcas.getDocumentText();
    StringBuffer buff = new StringBuffer();
    Parse parse = null;
    try{
      parse = ParserTool.parseLine(sent, parser, 1)[0];
      parse.show(buff);
    }catch(NullPointerException e){
      System.err.println("Parser error... no parse found... check POS tags of missed sentence (immediately above)");
    }
    if(parse == null){
      buff.append("(S null)");
View Full Code Here

      parse = converter.transformParseFromTagger(parse);

      if (mLogger.isLoggable(Level.INFO)) {
        StringBuffer parseString = new StringBuffer();
        parse.show(parseString);

        mLogger.log(Level.INFO, parseString.toString());
      }

      createAnnotation(cas, sentenceAnnotation.getBegin(), parse);
View Full Code Here

//        System.err.println("String of length 0");
        parseBuff.append("");
        parse = null;
      }else{
        parse = ParserTool.parseLine(sentStr, parser, 1)[0];
        parse.show(parseBuff);
      }
//      Span span = parse.getSpan();
      parseStr = parseBuff.toString();
      TopTreebankNode top = new TopTreebankNode(jcas, sentAnnot.getBegin(), sentAnnot.getEnd());
      top.setTreebankParse(parseBuff.toString());
View Full Code Here

    String sent = jcas.getDocumentText();
    StringBuffer buff = new StringBuffer();
    Parse parse = null;
    try{
      parse = ParserTool.parseLine(sent, parser, 1)[0];
      parse.show(buff);
    }catch(NullPointerException e){
      System.err.println("Parser error... no parse found... check POS tags of missed sentence (immediately above)");
    }
    if(parse == null){
      buff.append("(S null)");
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.