Examples of Parse


Examples of com.gtranslate.parsing.Parse

  }

  public void translate(TextTranslate textTranslate) {

    Parse parse = new ParseTextTranslate(textTranslate);
    parse.parse();

  }
View Full Code Here

Examples of com.owens.oobjloader.parser.Parse

      while ((len = stream.read(buffer)) != -1){
        out.write(buffer, 0, len);
      }
      out.close();

      new Parse(builder, temp.getAbsolutePath());
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
    }
    genArrayList();
View Full Code Here

Examples of fit.Parse

      }
    }

    public void exception(Throwable e)
    {
      Parse cell = cells.get(0);
      cell.addToBody("<hr/>" + label(e.toString()));
      cell.addToTag(" class=\"error\"");
    }
View Full Code Here

Examples of net.nutch.parse.Parse

    String urlString;
    Protocol protocol;
    Content content;
    Parser parser;
    Parse parse;

    urlString = "file:" + sampleDir + fileSeparator + id3v2;
    protocol = ProtocolFactory.getProtocol(urlString);
    content = protocol.getContent(urlString);

    parser = ParserFactory.getParser(content.getContentType(), urlString);
    parse = parser.getParse(content);
    Properties metadata = parse.getData().getMetadata();
    assertEquals("postgresql comment id3v2", metadata.getProperty("COMM-Text"));
    assertEquals("postgresql composer id3v2", metadata.getProperty("TCOM-Text"));
    assertEquals("02", metadata.getProperty("TRCK-Text"));
    assertEquals("http://localhost/", metadata.getProperty("WCOP-URL Link"));
    assertEquals("postgresql artist id3v2", metadata.getProperty("TPE1-Text"));
    assertEquals("(28)", metadata.getProperty("TCON-Text"));
    assertEquals("2004", metadata.getProperty("TYER-Text"));
    assertEquals("postgresql title id3v2", metadata.getProperty("TIT2-Text"));
    assertEquals("postgresql album id3v2", metadata.getProperty("TALB-Text"));
    assertEquals("postgresql encoded by id3v2", metadata.getProperty("TENC-Text"));

    assertEquals("postgresql title id3v2 - "
        + "postgresql album id3v2 - "
        + "postgresql artist id3v2", parse.getData().getTitle());
    assertEquals("http://localhost/", parse.getData().getOutlinks()[0].getToUrl());

  }
View Full Code Here

Examples of opennlp.tools.coref.mention.Parse

    int mentionInSentenceIndex=-1;
    int numMentionsInSentence=-1;
    int prevSentenceIndex = -1;
    MentionContext[] contexts = new MentionContext[mentions.length];
    for (int mi=0,mn=mentions.length;mi<mn;mi++) {
      Parse mentionParse = mentions[mi].getParse();
      //System.err.println("AbstractLinker.constructMentionContexts: mentionParse="+mentionParse);
      if (mentionParse == null) {
        System.err.println("no parse for "+mentions[mi]);
      }
      int sentenceIndex = mentionParse.getSentenceNumber();
      if (sentenceIndex != prevSentenceIndex) {
        mentionInSentenceIndex=0;
        prevSentenceIndex = sentenceIndex;
        numMentionsInSentence = 0;
        for (int msi=mi;msi<mentions.length;msi++) {
View Full Code Here

Examples of opennlp.tools.coref.mention.Parse

  protected List<String> getNonReferentialFeatures(MentionContext mention) {
    List<String> features = new ArrayList<String>();
    Parse[] mtokens = mention.getTokenParses();
    //System.err.println("getNonReferentialFeatures: mention has "+mtokens.length+" tokens");
    for (int ti = 0; ti <= mention.getHeadTokenIndex(); ti++) {
      Parse tok = mtokens[ti];
      List<String> wfs = ResolverUtils.getWordFeatures(tok);
      for (int wfi = 0; wfi < wfs.size(); wfi++) {
        features.add("nr" + wfs.get(wfi));
      }
    }
View Full Code Here

Examples of opennlp.tools.coref.mention.Parse

  }

  public static Set<String> constructModifierSet(Parse[] tokens, int headIndex) {
    Set<String> modSet = new HashSet<String>();
    for (int ti = 0; ti < headIndex; ti++) {
      Parse tok = tokens[ti];
      modSet.add(tok.toString().toLowerCase());
    }
    return (modSet);
  }
View Full Code Here

Examples of opennlp.tools.coref.mention.Parse

  public static String excludedDeterminerMentionString(MentionContext ec) {
    StringBuffer sb = new StringBuffer();
    boolean first = true;
    Parse[] mtokens = ec.getTokenParses();
    for (int ti = 0, tl = mtokens.length; ti < tl; ti++) {
      Parse token = mtokens[ti];
      String tag = token.getSyntacticType();
      if (!tag.equals("DT")) {
        if (!first) {
          sb.append(" ");
        }
        sb.append(token.toString());
        first = false;
      }
    }
    return sb.toString();
  }
View Full Code Here

Examples of opennlp.tools.parser.Parse

    POSTaggerME tagger =  new POSTaggerME(posModel);
    Parser parser = new ChunkParser(chunker, tagger);
    Parse[] results = ParserTool.parseLine("The Minnesota Twins , " +
            "the 1991 World Series Champions , are currently in third place .",
            parser, 1);
    Parse p = results[0];
    Parse[] chunks = p.getChildren();
    assertTrue(chunks.length == 9);
    assertTrue(chunks[0].getType().equals("NP"));
    assertTrue(chunks[0].getHead().toString().equals("Twins"));
    //<end id="openChunkParse"/>
  }
View Full Code Here

Examples of opennlp.tools.parser.Parse

  @Override
  public Query parse() throws ParseException {

    //<start id="qqp.parse"/>
    Parse parse = ParserTool.parseLine(qstr, parser, 1)[0];//<co id="qqp.parseLine"/>
    /*
    <calloutlist>
        <callout arearefs="qqp.parseLine"><para>Parse the question using the <classname>TreebankParser</classname>.  The resulting <classname>Parse</classname> object can then be utilized by the classifier to determine the Answer Type.</para></callout>
    </calloutlist>
    */
 
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.