Examples of RelationshipList


Examples of net.didion.jwnl.data.relationship.RelationshipList

    hyponyms.print();
  }

  private void demonstrateAsymmetricRelationshipOperation(IndexWord start, IndexWord end) throws JWNLException {
    // Try to find a relationship between the first sense of <var>start</var> and the first sense of <var>end</var>
    RelationshipList list = RelationshipFinder.getInstance().findRelationships(start.getSense(1), end.getSense(1), PointerType.HYPERNYM);
    System.out.println("Hypernym relationship between \"" + start.getLemma() + "\" and \"" + end.getLemma() + "\":");
    for (Iterator itr = list.iterator(); itr.hasNext();) {
      ((Relationship) itr.next()).getNodeList().print();
    }
    System.out.println("Common Parent Index: " + ((AsymmetricRelationship) list.get(0)).getCommonParentIndex());
    System.out.println("Depth: " + ((Relationship) list.get(0)).getDepth());
  }
View Full Code Here

Examples of net.didion.jwnl.data.relationship.RelationshipList

    System.out.println("Depth: " + ((Relationship) list.get(0)).getDepth());
  }

  private void demonstrateSymmetricRelationshipOperation(IndexWord start, IndexWord end) throws JWNLException {
    // find all synonyms that <var>start</var> and <var>end</var> have in common
    RelationshipList list = RelationshipFinder.getInstance().findRelationships(start.getSense(1), end.getSense(1), PointerType.SIMILAR_TO);
    System.out.println("Synonym relationship between \"" + start.getLemma() + "\" and \"" + end.getLemma() + "\":");
    for (Iterator itr = list.iterator(); itr.hasNext();) {
      ((Relationship) itr.next()).getNodeList().print();
    }
    System.out.println("Depth: " + ((Relationship) list.get(0)).getDepth());
  }
View Full Code Here

Examples of net.didion.jwnl.data.relationship.RelationshipList

    hyponyms.print();
  }

  private void demonstrateAsymmetricRelationshipOperation(IndexWord start, IndexWord end) throws JWNLException {
    // Try to find a relationship between the first sense of <var>start</var> and the first sense of <var>end</var>
    RelationshipList list = RelationshipFinder.getInstance().findRelationships(start.getSense(1), end.getSense(1), PointerType.HYPERNYM);
    System.out.println("Hypernym relationship between \"" + start.getLemma() + "\" and \"" + end.getLemma() + "\":");
    for (Iterator itr = list.iterator(); itr.hasNext();) {
      ((Relationship) itr.next()).getNodeList().print();
    }
    System.out.println("Common Parent Index: " + ((AsymmetricRelationship) list.get(0)).getCommonParentIndex());
    System.out.println("Depth: " + ((Relationship) list.get(0)).getDepth());
  }
View Full Code Here

Examples of net.didion.jwnl.data.relationship.RelationshipList

    System.out.println("Depth: " + ((Relationship) list.get(0)).getDepth());
  }

  private void demonstrateSymmetricRelationshipOperation(IndexWord start, IndexWord end) throws JWNLException {
    // find all synonyms that <var>start</var> and <var>end</var> have in common
    RelationshipList list = RelationshipFinder.getInstance().findRelationships(start.getSense(1), end.getSense(1), PointerType.SIMILAR_TO);
    System.out.println("Synonym relationship between \"" + start.getLemma() + "\" and \"" + end.getLemma() + "\":");
    for (Iterator itr = list.iterator(); itr.hasNext();) {
      ((Relationship) itr.next()).getNodeList().print();
    }
    System.out.println("Depth: " + ((Relationship) list.get(0)).getDepth());
  }
View Full Code Here

Examples of net.didion.jwnl.data.relationship.RelationshipList

        return Integer.MAX_VALUE;

      Synset startSynset = start.getSense(1);
      Synset endSynset = end.getSense(1);

      RelationshipList list = RelationshipFinder.getInstance()
          .findRelationships(startSynset, endSynset, type);
      // System.out.println("Synonym relationship between \"" +
      // start.getLemma() + "\" and \"" + end.getLemma() + "\":");
      // for (Iterator itr = list.iterator(); itr.hasNext();)
      // ((Relationship) itr.next()).getNodeList().print();

      // if(!list.isEmpty())
      // System.out.println("Depth: " + ((Relationship)
      // list.get(0)).getDepth());
      int res = list.size();
      if (res > 0)
        return list.size();
      else
        return Integer.MAX_VALUE;
    } catch (Exception e) {
      org.apache.commons.logging.LogFactory.getLog(WordNetBridge.class)
          .error(e);
View Full Code Here

Examples of weave.config.DataConfig.RelationshipList

    PreparedStatement stmt = null;
    String query = null;
    try
    {
      Connection conn = connectionConfig.getAdminConnection();
      RelationshipList result = new RelationshipList();
      if (ids.size() == 0)
        return result;
     
      // build query
      String idList = Strings.join(",", ids);
      query = String.format(
          "SELECT * FROM %s WHERE %s IN (%s) OR %s IN (%s) ORDER BY %s",
          SQLUtils.quoteSchemaTable(conn, schemaName, tableName),
          SQLUtils.quoteSymbol(conn, FIELD_PARENT), idList,
          SQLUtils.quoteSymbol(conn, FIELD_CHILD), idList,
          SQLUtils.quoteSymbol(conn, FIELD_ORDER)
        );
      stmt = conn.prepareStatement(query);
      rs = stmt.executeQuery();
      rs.setFetchSize(SQLResult.FETCH_SIZE);
      while (rs.next())
        result.add(new Relationship(rs.getInt(FIELD_PARENT), rs.getInt(FIELD_CHILD)));
      return result;
    }
    catch (SQLException e)
    {
      if (query != 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.