Examples of lookupEntries()


Examples of edu.stanford.nlp.sempre.fbalignment.lexicons.BinaryLexicon.lookupEntries()

  @Test(groups = "emnlp2013")
  public void binary() throws IOException {
    BinaryLexicon.opts.keyToSortBy = BinaryLexicon.INTERSECTION;

    BinaryLexicon lexicon = new BinaryLexicon();
    List<BinaryLexicalEntry> entries = lexicon.lookupEntries("bear in");
    BinaryLexicalEntry top = entries.get(0);
    assertEquals("people born here", top.fbDescriptions.iterator().next());
    assertEquals("!fb:location.location.people_born_here", top.formula.toString());
    assertEquals("ALIGNMENT", top.source.toString());
    assertEquals(759773.0,top.popularity,0.00001)// Based on 93.exec (full Freebase)
View Full Code Here

Examples of edu.stanford.nlp.sempre.fbalignment.lexicons.UnaryLexicon.lookupEntries()

    UnaryLexicon unary = new UnaryLexicon();
    boolean existsAlignment = false, existsStringMatch=false;
    double popularity=0.0;
    double intersection=0.0;
   
    List<UnaryLexicalEntry> entries = unary.lookupEntries("continent");
    LogInfo.logs("Num of entries: %s",entries.size());
    for(UnaryLexicalEntry entry: entries) {
      if(entry.formula.toString().equals("(fb:type.object.type fb:location.continent)")) {
        if(entry.source==EntrySource.ALIGNMENT) {
          existsAlignment=true;
View Full Code Here

Examples of edu.stanford.nlp.sempre.fbalignment.lexicons.UnaryLexicon.lookupEntries()

   
    existsAlignment = false;
    existsStringMatch=false;
    popularity=0.0;
    intersection=0.0;
    entries = unary.lookupEntries("lawyer");
    for(UnaryLexicalEntry entry: entries) {
      if(entry.formula.toString().equals("(fb:people.person.profession fb:en.attorney)")) {
        if(entry.source==EntrySource.ALIGNMENT) {
          existsAlignment=true;
          intersection = entry.alignmentScores.get(UnaryLexicon.INTERSECTION);
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.