|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsofie.maxsat.Rule
public class Rule
Class Rule This class is part of the SOFIE system (http://mpii.de/yago-naga/sofie). It is licensed under the Creative Commons Attribution-Noncommercial-Share-Alike 3.0 Unported License (http://creativecommons.org/licenses/by-nc-sa/3.0/) by Fabian M. Suchanek (http://suchanek.name). If you use this class for scientific purposes, please cite Fabian M. Suchanek, Mauro Sozio, Gerhard Weikum "SOFIE: A Self-Organizing Framework for Information Extraction" (International World Wide Web Conference 2009) This class represents a rule, i.e. a disjunction of literals.
Field Summary | |
---|---|
protected static int |
allIds
Counts all existing rules |
protected java.lang.String |
description
Holds a description |
protected int |
id
Holds the id of the current rule |
protected java.util.List<Literal> |
literals
Holds the literals |
protected int |
numFreeLiterals
Holds the number of free literals |
protected java.util.List<Literal>[] |
resolveOrder
Given the index of one literal, lists the literals to be instantiated next |
protected double |
weight
Holds the weight of this rule |
Constructor Summary | |
---|---|
Rule(java.lang.String description,
double weight,
java.util.List<Literal> literals)
Constructs a rule |
|
Rule(java.lang.String description,
double weight,
Literal... literals)
Constructs a rule |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
protected void |
ground(java.util.List<Literal> literalsToDo,
int numUnsatisfied,
double weight,
java.util.Map<java.lang.String,java.lang.String> bindings,
Literal freeLiteral,
Measures measures,
java.util.List<Hypothesis> grounded)
Helper for groundedrules(), fills a list of grounded rules |
int |
hashCode()
|
int |
indexOf(Literal lit)
Returns the index of the literal (for some instantiuation of the variables) |
Literal |
literal(int i)
Returns the ith literal |
static java.util.List<Rule> |
loadFrom(java.io.File file)
Returns the rules defined in that file |
static void |
main(java.lang.String[] args)
Test |
int |
numLiterals()
|
static Rule |
parse(java.lang.String line,
java.lang.String description)
Parses a line into a rule. |
protected static Literal |
resolveNext(java.util.List<Literal> toDo,
java.util.Set<java.lang.String> knownVariables)
Returns the Literal from the list that has to be instantiated next, given a set of known variables |
java.lang.String |
toString()
|
void |
updateMeasures(Hypothesis hyp,
Measures measures)
Adds the measures of unsatisfied rules |
double |
weight()
returns the rule weight |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static int allIds
protected int id
protected java.lang.String description
protected java.util.List<Literal> literals
protected int numFreeLiterals
protected double weight
protected java.util.List<Literal>[] resolveOrder
Constructor Detail |
---|
public Rule(java.lang.String description, double weight, Literal... literals)
public Rule(java.lang.String description, double weight, java.util.List<Literal> literals)
Method Detail |
---|
public Literal literal(int i)
protected static Literal resolveNext(java.util.List<Literal> toDo, java.util.Set<java.lang.String> knownVariables)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int numLiterals()
public int indexOf(Literal lit)
public double weight()
public static Rule parse(java.lang.String line, java.lang.String description)
public static java.util.List<Rule> loadFrom(java.io.File file) throws java.io.IOException
java.io.IOException
public void updateMeasures(Hypothesis hyp, Measures measures) throws java.sql.SQLException
java.sql.SQLException
protected void ground(java.util.List<Literal> literalsToDo, int numUnsatisfied, double weight, java.util.Map<java.lang.String,java.lang.String> bindings, Literal freeLiteral, Measures measures, java.util.List<Hypothesis> grounded) throws java.sql.SQLException
java.sql.SQLException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |