示例#1
0
  public void predictAsLink(
      Graph graph, Iterable<Edge> unknownedges, boolean removenotexist, String existfeature) {
    // Add co-reference edge schema and feature, but do nothing else

    // Add schema, if not already defined
    if (!graph.hasSchema(this.edgeschemaid)) {
      graph.addSchema(this.edgeschemaid, new Schema(SchemaType.UNDIRECTED));
    }

    // Add existence feature, if not already defined
    Schema schema = graph.getSchema(this.edgeschemaid);
    if (!schema.hasFeature(existfeature)) {
      schema.addFeature(existfeature, LinkPredictor.EXISTENCEFEATURE);
      graph.updateSchema(this.edgeschemaid, schema);
    }
  }
示例#2
0
 public void predictAsLink(Graph graph, PotentialLinkGenerator generator) {
   // Add co-reference edge schema, but do nothing else
   if (!graph.hasSchema(this.edgeschemaid)) {
     graph.addSchema(this.edgeschemaid, new Schema(SchemaType.UNDIRECTED));
   }
 }