|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for a search engine. Store and retrieve document vectors and document data by document identifier. The content of the document identifier is up to the specific implementation. The document data stored may contain the document content in addition to any other identifying information that needs to be stored.. Each implementation of this interface is responsible for its own internal representations. Each class will probably have special initialization requirements and should provide appropriate methods there.
Method Summary | |
void |
addDocument(java.io.Serializable docId,
java.io.Serializable docData,
TermVector docVector)
Add a vector to the collection. |
boolean |
docExists(java.io.Serializable docId)
Returns true if a document with that ID is already in the database. |
boolean |
equals(java.lang.Object o)
Indicates whether an object is equal to this SearchEngine |
java.lang.String |
getDescription()
Returns a textual description of this information source. |
java.io.Serializable |
getDocData(java.io.Serializable docId)
Returns the document data associated with docId. |
java.lang.String |
getMetricName()
Returns the name of the similarity metric used by this class. |
java.lang.String |
getName()
Returns the name of this particular source. |
double |
getSimilarityScore(TermVector vector1,
TermVector vector2)
Returns the similarity of the two vectors based on the metric indicated by getMetricName() . |
TermVector |
getVector(java.io.Serializable docId)
Get the vector for the given document. |
java.util.Iterator |
iterator()
Returns an iterator over the document identifiers. |
ValueSortedMap |
retrieveDocuments(TermVector vector,
int numSimilar)
Return a list of document identifiers with documents similar to the given vector, sorted by similarity. |
void |
setDescription(java.lang.String description)
Sets the description of this particular search engine |
void |
setDocData(java.io.Serializable docId,
java.io.Serializable docData)
Sets the document's data. |
void |
setName(java.lang.String name)
Sets the name of this particular source. |
void |
setVector(java.io.Serializable docId,
TermVector docVector)
Change the vector for docId to the given vector. |
Method Detail |
public java.lang.String getDescription()
getDescription
in interface InformationSource
public void setDescription(java.lang.String description)
public java.lang.String getName()
getName
in interface InformationSource
public void setName(java.lang.String name)
public java.lang.String getMetricName()
public double getSimilarityScore(TermVector vector1, TermVector vector2)
getMetricName()
.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void addDocument(java.io.Serializable docId, java.io.Serializable docData, TermVector docVector) throws SearchEngineException
SearchEngineException
public void setVector(java.io.Serializable docId, TermVector docVector)
public TermVector getVector(java.io.Serializable docId)
public java.io.Serializable getDocData(java.io.Serializable docId)
public void setDocData(java.io.Serializable docId, java.io.Serializable docData)
public ValueSortedMap retrieveDocuments(TermVector vector, int numSimilar)
retrieveDocuments
in interface InformationSource
numSimilar
- The maximum number of documents to return. If
0, return all documents.
public boolean docExists(java.io.Serializable docId)
public java.util.Iterator iterator()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |