|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.languagecomputer.api.text.DefaultText com.languagecomputer.api.query.DefaultAnswer
public class DefaultAnswer
Default implementation of a Answer
.
Alternatively, the Answer
interface may be implemented in order
to be backed by a different mechanism (i.e., for speed and/or memory
performance based on the individual system).
Field Summary |
---|
Fields inherited from interface com.languagecomputer.api.query.Answer |
---|
TYPE |
Constructor Summary | |
---|---|
DefaultAnswer()
Creates a new DefaultAnswer . |
Method Summary | |
---|---|
double |
getConfidence()
Returns the confidence of this Answer in the range of
(0.0-1.0] (optional). |
String |
getDocumentID()
Returns the Document ID that identifies this Text . If the Document is attached to this
DefaultAnswer , then its ID will be used. |
String |
getPassage()
Returns the passage context of this Answer . |
void |
setAnnotationType(AnnotationType annType)
Not necessary: defaults to Answer.TYPE . |
void |
setConfidence(double confidence)
Sets the confidence to use for this DefaultAnswer . |
void |
setDocumentID(String docID)
Explicitly sets the document ID for when no Document is attached to
this DefaultAnswer . |
void |
setPassage(String passage)
Sets the passage to use for this DefaultAnswer . |
Methods inherited from class com.languagecomputer.api.text.DefaultText |
---|
getAnnotationType, getCongruentAnnotations, getDocument, getEndCharOffset, getIntersectingAnnotations, getRawString, getStartCharOffset, getSubAnnotations, getSuperAnnotations, setDocument, setEndCharOffset, setRawString, setStartCharOffset, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.languagecomputer.api.text.Text |
---|
getAnnotationType, getCongruentAnnotations, getDocument, getEndCharOffset, getIntersectingAnnotations, getRawString, getStartCharOffset, getSubAnnotations, getSuperAnnotations |
Constructor Detail |
---|
public DefaultAnswer()
DefaultAnswer
.
Method Detail |
---|
public void setAnnotationType(AnnotationType annType)
Answer.TYPE
.
setAnnotationType
in class DefaultText
annType
- AnnotationType
to use for this
DefaultEntity
.Text.getAnnotationType()
,
AnnotationType
public void setConfidence(double confidence)
DefaultAnswer
.
answer
- Answer confidence/relevance/weight/score/etc, must be within
the range (0.0-1.0]
.
IllegalArgumentException
- If the confidence does not fall
within the expected range.getConfidence()
public double getConfidence()
Answer
in the range of
(0.0-1.0]
(optional). Confidence can be considered as
relevance, score, or any other metric used to rank answers.
getConfidence
in interface Answer
Answer
.public void setDocumentID(String docID)
Document
is attached to
this DefaultAnswer
. When serialized, the Document
is dropped for performance, so the document ID is needed to retrieve the
document when/if necessary.
getDocumentID()
public String getDocumentID()
Document
ID that identifies this Text
. If the Document
is attached to this
DefaultAnswer
, then its ID will be used. Otherwise, the ID
set by setDocumentID(String)
is used.
getDocumentID
in interface Text
getDocumentID
in class DefaultText
Document
that contains this
Text
.public void setPassage(String passage)
DefaultAnswer
.
passage
- The passage String
.getPassage()
public String getPassage()
Answer
. For passage-style
answers, this may either be equal to the Text.getRawString()
or have even
more context. For exact-style answers, getRawString
returns
the exact answer while this method returns the context.
getPassage
in interface Answer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |