|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnars.entity.Sentence
public abstract class Sentence
A Sentence is an abstract class, mainly containing a Term, a TruthValue, and a Stamp.
It is used as the premises and conclusions of all inference rules.
| Field Summary | |
|---|---|
protected Judgment |
bestSolution
For Question and Goal: best solution found so far |
protected Term |
content
The content of a Sentence is a Term |
protected boolean |
input
Whether it is an input sentence |
protected char |
punctuation
The punctuation also indicates the type of the Sentence: Judgment, Question, or Goal |
protected Stamp |
stamp
Partial record of the derivation path |
protected TemporalValue |
temporalOrder
Temporal order between the components |
protected TruthValue |
truth
The truth value of Judgment or desire value of Goal |
| Constructor Summary | |
|---|---|
Sentence()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clone the Sentence |
Term |
cloneContent()
Clone the content of the sentence |
Judgment |
getBestSolution()
Get the best-so-far solution for a Question or Goal |
Term |
getContent()
Get the content of the sentence |
long |
getCreationTime()
Get the creation time of the truth-value from the Stamp |
long |
getEventTime()
Get the occurrence time of the event |
Stamp |
getStamp()
Get the stamp of the sentence |
TemporalValue |
getTense()
Get the tense of the Sentence |
TruthValue |
getTruth()
Get the truth value of the sentence |
boolean |
isInput()
Check input sentence |
boolean |
isJudgment()
Distinguish Judgment from Goal ("instanceof Judgment" doesn't work) |
static Sentence |
make(Sentence oldS,
Term term,
TruthValue truth,
Stamp stamp,
TemporalValue tense)
Make a derived Sentence from a template and some initial values. |
static Sentence |
make(Term term,
char punc,
TruthValue truth,
Stamp stamp,
TemporalValue tense)
Make a Sentence from an input String. |
boolean |
noOverlapping(Sentence that)
Check whether one sentence has stamp overlapping with another one, and change the system cash |
void |
setBestSolution(Judgment judg)
Set the best-so-far solution for a Question or Goal |
void |
setContent(Term t)
Set the content Term of the Sentence |
void |
setInput()
The only place to change the default, called in StringParser |
java.lang.String |
tenseToString()
Get a String representation of the tense of the sentence |
java.lang.String |
toKey()
Get a stable String representation for a Sentece Different from toString: tense symbol is replaced by the actual value |
java.lang.String |
toString()
Get a String representation of the sentence |
java.lang.String |
toString2()
Get a String representation of the sentence, with 2-digit accuracy |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Term content
protected char punctuation
protected TruthValue truth
protected Stamp stamp
protected boolean input
protected Judgment bestSolution
protected TemporalValue temporalOrder
| Constructor Detail |
|---|
public Sentence()
| Method Detail |
|---|
public static Sentence make(Term term,
char punc,
TruthValue truth,
Stamp stamp,
TemporalValue tense)
term - The content of the sentencepunc - The puncuation (and therefore, type) of the sentencetense - The tense of the sntensetruth - The truth value of the sentence, if it is a Judgment (or Goal)stamp - The stamp of the truth value (for Judgment or Goal)
public static Sentence make(Sentence oldS,
Term term,
TruthValue truth,
Stamp stamp,
TemporalValue tense)
term - The content of the sentenceoldS - A sample sentence providing the type of the new sentencetense - The tense of the sentencetruth - The truth value of the sentence, if it is a Judgment (or Goal)stamp - The stamp of the truth value (for Judgment or Goal)
public java.lang.Object clone()
clone in class java.lang.Objectpublic Term getContent()
public Term cloneContent()
public void setContent(Term t)
t - The new contentpublic TemporalValue getTense()
public TruthValue getTruth()
public Stamp getStamp()
public boolean isJudgment()
public boolean isInput()
public void setInput()
public Judgment getBestSolution()
public void setBestSolution(Judgment judg)
judg - The solution to be rememberedpublic boolean noOverlapping(Sentence that)
that - The sentence to be checked against
public java.lang.String toKey()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString2()
public java.lang.String tenseToString()
public long getCreationTime()
public long getEventTime()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||