public class Polarity
extends java.lang.Object
A class intended to be attached to a lexical item, determining what mutations are valid on it while maintaining valid Natural Logic inference.
Modifier and Type | Field and Description |
---|---|
static Polarity |
DEFAULT
The default (very permissive) polarity.
|
Modifier | Constructor and Description |
---|---|
|
Polarity(byte[] projectionFunction)
Create a polarity item by directly copying the projection function from
NaturalLogicRelation s to
their projected relation. |
protected |
Polarity(java.util.List<Pair<Monotonicity,MonotonicityType>> operatorsInNarrowingScopeOrder)
Create a polarity from a list of operators in scope
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isDownwards()
Ignoring exclusion, determine if this word has downward polarity.
|
boolean |
isUpwards()
Ignoring exclusion, determine if this word has upward polarity.
|
boolean |
maintainsFalsehood(NaturalLogicRelation lexicalRelation) |
boolean |
maintainsTruth(NaturalLogicRelation lexicalRelation)
If true, applying this lexical relation to this word creates a sentence which is entailed by the original sentence,
Note that both this, and
negatesTruth(NaturalLogicRelation) can be false. |
boolean |
negatesFalsehood(NaturalLogicRelation lexicalRelation) |
boolean |
negatesTruth(NaturalLogicRelation lexicalRelation)
If true, applying this lexical relation to this word creates a sentence which is negated by the original sentence
Note that both this, and
maintainsTruth(NaturalLogicRelation) } can be false. |
NaturalLogicRelation |
projectLexicalRelation(NaturalLogicRelation lexicalRelation)
Project the given natural logic lexical relation on this word.
|
java.lang.String |
toString() |
public static final Polarity DEFAULT
protected Polarity(java.util.List<Pair<Monotonicity,MonotonicityType>> operatorsInNarrowingScopeOrder)
public Polarity(byte[] projectionFunction)
NaturalLogicRelation
s to
their projected relation.public NaturalLogicRelation projectLexicalRelation(NaturalLogicRelation lexicalRelation)
NaturalLogicRelation.FORWARD_ENTAILMENT
) on this word,
then this function will tell you what relation holds between the new mutated fact and this fact.lexicalRelation
- The lexical relation we are applying to this word.public boolean maintainsTruth(NaturalLogicRelation lexicalRelation)
negatesTruth(NaturalLogicRelation)
can be false. If this is the case, then
natural logic can neither verify nor disprove this mutation.public boolean negatesTruth(NaturalLogicRelation lexicalRelation)
maintainsTruth(NaturalLogicRelation)
} can be false. If this is the case, then
natural logic can neither verify nor disprove this mutation.public boolean maintainsFalsehood(NaturalLogicRelation lexicalRelation)
maintainsTruth(NaturalLogicRelation)
public boolean negatesFalsehood(NaturalLogicRelation lexicalRelation)
negatesTruth(NaturalLogicRelation)
public boolean isUpwards()
public boolean isDownwards()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object