public enum NaturalLogicRelation extends java.lang.Enum<NaturalLogicRelation>
Enum Constant and Description |
---|
ALTERNATION |
COVER |
EQUIVALENT |
FORWARD_ENTAILMENT |
INDEPENDENCE |
NEGATION |
REVERSE_ENTAILMENT |
Modifier and Type | Field and Description |
---|---|
int |
fixedIndex
A fixed index for this relation, so that it can be serialized more efficiently.
|
boolean |
maintainsFalsehood
Determines whether this relation maintains the falsehood of a false fact.
|
boolean |
maintainsTruth
Determines whether this relation maintains the truth of a fact in a true context.
|
boolean |
negatesFalsehood
Determines whether this relation negates the truth of a fact in a false context.
|
boolean |
negatesTruth
Determines whether this relation negates the truth of a fact in a true context.
|
Modifier and Type | Method and Description |
---|---|
Trilean |
applyToTruthValue(boolean initialTruthValue)
Implements the finite state automata of composing the truth value of a sentence with a natural logic relation being
applied.
|
protected static NaturalLogicRelation |
byFixedIndex(int index) |
static NaturalLogicRelation |
forDependencyDeletion(java.lang.String dependencyLabel)
Returns the natural logic relation corresponding to the given dependency arc being deleted from a sentence.
|
static NaturalLogicRelation |
forDependencyDeletion(java.lang.String dependencyLabel,
boolean isSubject)
Returns the natural logic relation corresponding to the given dependency arc being deleted from a sentence.
|
static NaturalLogicRelation |
forDependencyDeletion(java.lang.String dependencyLabel,
boolean isSubject,
java.util.Optional<java.lang.String> dependent)
Returns the natural logic relation corresponding to the given dependency arc being deleted from a sentence.
|
static NaturalLogicRelation |
forDependencyInsertion(java.lang.String dependencyLabel)
Returns the natural logic relation corresponding to the given dependency arc being inserted into a sentence.
|
static NaturalLogicRelation |
forDependencyInsertion(java.lang.String dependencyLabel,
boolean isSubject)
Returns the natural logic relation corresponding to the given dependency arc being inserted into a sentence.
|
static NaturalLogicRelation |
forDependencyInsertion(java.lang.String dependencyLabel,
boolean isSubject,
java.util.Optional<java.lang.String> dependent)
Returns the natural logic relation corresponding to the given dependency arc being inserted into a sentence.
|
NaturalLogicRelation |
join(NaturalLogicRelation other)
The MacCartney "join table" -- this determines the transitivity of entailment if we chain two relations together.
|
static boolean |
knownDependencyArc(java.lang.String dependencyLabel)
Returns whether this is a known dependency arc.
|
static NaturalLogicRelation |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static NaturalLogicRelation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NaturalLogicRelation EQUIVALENT
public static final NaturalLogicRelation FORWARD_ENTAILMENT
public static final NaturalLogicRelation REVERSE_ENTAILMENT
public static final NaturalLogicRelation NEGATION
public static final NaturalLogicRelation ALTERNATION
public static final NaturalLogicRelation COVER
public static final NaturalLogicRelation INDEPENDENCE
public final int fixedIndex
public final boolean maintainsTruth
public final boolean negatesTruth
public final boolean maintainsFalsehood
public final boolean negatesFalsehood
public static NaturalLogicRelation[] values()
for (NaturalLogicRelation c : NaturalLogicRelation.values()) System.out.println(c);
public static NaturalLogicRelation valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullprotected static NaturalLogicRelation byFixedIndex(int index)
public NaturalLogicRelation join(NaturalLogicRelation other)
Polarity.projectLexicalRelation(NaturalLogicRelation)
,
set by NaturalLogicAnnotator
using the NaturalLogicAnnotations.PolarityAnnotation
).other
- The relation to join this relation with.public Trilean applyToTruthValue(boolean initialTruthValue)
initialTruthValue
- The truth value of the premise (the original sentence).Trilean.UNKNOWN
indicates that natural logic cannot either confirm or disprove the truth
of the consequent.public static boolean knownDependencyArc(java.lang.String dependencyLabel)
public static NaturalLogicRelation forDependencyInsertion(java.lang.String dependencyLabel)
public static NaturalLogicRelation forDependencyInsertion(java.lang.String dependencyLabel, boolean isSubject)
dependencyLabel
- The label we are checking the relation for.isSubject
- Whether this is on the subject side of a relation (e.g., for CONJ_OR edges)public static NaturalLogicRelation forDependencyInsertion(java.lang.String dependencyLabel, boolean isSubject, java.util.Optional<java.lang.String> dependent)
dependencyLabel
- The label we are checking the relation for.isSubject
- Whether this is on the subject side of a relation (e.g., for CONJ_OR edges)dependent
- The dependent word of the dependency label.public static NaturalLogicRelation forDependencyDeletion(java.lang.String dependencyLabel)
public static NaturalLogicRelation forDependencyDeletion(java.lang.String dependencyLabel, boolean isSubject)
dependencyLabel
- The label we are checking the relation forisSubject
- Whether this is on the subject side of a relation (e.g., for CONJ_OR edges)public static NaturalLogicRelation forDependencyDeletion(java.lang.String dependencyLabel, boolean isSubject, java.util.Optional<java.lang.String> dependent)
dependencyLabel
- The label we are checking the relation forisSubject
- Whether this is on the subject side of a relation (e.g., for CONJ_OR edges)dependent
- The dependent word of the dependency label.