|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsofie.maxsat.Hypothesis
sofie.maxsat.Literal
public class Literal
Class Literal 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 literal, i.e. a hypothesis with a truth value, possibly containing variables.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class sofie.maxsat.Hypothesis |
---|
Hypothesis.Truth |
Field Summary | |
---|---|
static javatools.database.ResultIterator.ResultWrapper<Hypothesis> |
disambiguationPriorWrapper
Converts a hypothesis line |
protected Hypothesis.Truth |
hasInstances
TRUE if this literal has instances |
protected static javatools.database.ResultIterator.ResultWrapper<Hypothesis> |
patternOccurrencesWrapper
Converts a database line |
protected boolean |
polarity
Holds the polarity |
static javatools.database.ResultIterator.ResultWrapper<Hypothesis> |
yagoWrapper
Converts a database line |
Fields inherited from class sofie.maxsat.Hypothesis |
---|
components, DISAMBIGUATEDAS, DISAMBIGUATIONPRIOR, FLAGSET, PATTERNOCCURRENCES, priority, relation, value, WORDINCONTEXT |
Constructor Summary | |
---|---|
Literal(boolean pol,
java.util.List<java.lang.String> parts)
Constructs a literal |
|
Literal(boolean pol,
basics.datagraph.Relation r,
java.lang.String... a)
Constructs a literal |
|
Literal(boolean pol,
java.lang.String... parts)
Constructs a literal |
Method Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
bindingsToMatch(Hypothesis f,
java.util.Map<java.lang.String,java.lang.String> bindings)
Returns the bindings of variables of this literal that are necessary to match this literal to f. |
protected javatools.datatypes.PeekIterator<Hypothesis> |
closedWorldIterator(javatools.datatypes.PeekIterator<Hypothesis> it)
Helper routine for ground(). |
java.lang.Iterable<Hypothesis> |
ground()
Returns a set of grounded hypotheses for the literal. |
int |
groundPriority(java.util.Collection<java.lang.String> knownVariables)
Returns how good it would be to ground this literal with the current known variables |
boolean |
hasInstances()
TRUE for a literal that has instances |
boolean |
hasVariable()
TRUE if the literal contains a variable |
javatools.datatypes.PeekIterator<Hypothesis> |
instances()
Loads all instantiations of this literal from the database |
boolean |
isFree()
TRUE for free literals |
boolean |
isUnhappyWith(Hypothesis h)
TRUE if the literal is unhappy with this hypothesis |
static void |
main(java.lang.String[] args)
Test method |
boolean |
matches(Hypothesis f)
Returns the bindings of variables of this literal that are necessary to match this literal to f. |
protected static java.lang.String |
normalize(java.lang.String a)
Normalizes an identifier |
static Literal |
parse(java.lang.String lit)
Constructs a literal |
boolean |
polarity()
Returns the polarity |
Hypothesis.Truth |
polarityOf(Hypothesis f)
Returns the value of f, adjusted for polarity |
protected java.lang.Iterable<Hypothesis> |
singleHypothesis(boolean value)
Helper routine for ground(). |
Literal |
swapPolarity()
Swaps the polarity, returns THIS |
java.lang.String |
toString()
|
Literal |
withBindings(java.util.Map<java.lang.String,java.lang.String> bindings)
Applies the bindings |
Methods inherited from class sofie.maxsat.Hypothesis |
---|
arg, compareTo, component, components, containsPolysem, equals, hashCode, hasVirtualRelation, isEntity, isPolysem, isString, isVariable, numArgs, numComponents, priority, relationIfKnown, relationName, saveTo, saveTo, setPriority, setRelations, setValue, setValue, setValue, trace, value |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean polarity
protected static javatools.database.ResultIterator.ResultWrapper<Hypothesis> patternOccurrencesWrapper
public static javatools.database.ResultIterator.ResultWrapper<Hypothesis> yagoWrapper
public static javatools.database.ResultIterator.ResultWrapper<Hypothesis> disambiguationPriorWrapper
protected Hypothesis.Truth hasInstances
Constructor Detail |
---|
public Literal(boolean pol, java.util.List<java.lang.String> parts)
public Literal(boolean pol, java.lang.String... parts)
public Literal(boolean pol, basics.datagraph.Relation r, java.lang.String... a)
Method Detail |
---|
public boolean polarity()
public Literal swapPolarity()
public Hypothesis.Truth polarityOf(Hypothesis f)
public boolean isUnhappyWith(Hypothesis h)
public java.lang.String toString()
toString
in class Hypothesis
public java.util.Map<java.lang.String,java.lang.String> bindingsToMatch(Hypothesis f, java.util.Map<java.lang.String,java.lang.String> bindings)
public Literal withBindings(java.util.Map<java.lang.String,java.lang.String> bindings)
public boolean matches(Hypothesis f)
public boolean isFree()
public int groundPriority(java.util.Collection<java.lang.String> knownVariables)
public boolean hasVariable()
protected java.lang.Iterable<Hypothesis> singleHypothesis(boolean value)
protected javatools.datatypes.PeekIterator<Hypothesis> closedWorldIterator(javatools.datatypes.PeekIterator<Hypothesis> it)
public java.lang.Iterable<Hypothesis> ground() throws java.sql.SQLException
java.sql.SQLException
protected static java.lang.String normalize(java.lang.String a)
public static Literal parse(java.lang.String lit)
public javatools.datatypes.PeekIterator<Hypothesis> instances() throws java.sql.SQLException
java.sql.SQLException
public boolean hasInstances() 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 |