TextDatabase
Class DocumentTreeSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.TreeSet
              extended by TextDatabase.DocumentTreeSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.Set, java.util.SortedSet

public class DocumentTreeSet
extends java.util.TreeSet

A DocumentTreeSet is a TreeSet of Documents

See Also:
Serialized Form

Field Summary
static java.lang.String documentDirectory
          Holds the directory of the documents
 
Constructor Summary
DocumentTreeSet()
          Initializes the Document Tree Set by reading all the documents held in the document directory
 
Method Summary
 double getAlternateDocumentRank(Query Query, Document Document)
          Gets the document rank for the specified query.
 Document getDocument(java.lang.String DocumentName)
          Returns the document with the corresponding document name
 double getDocumentRank(Query Query, Document Document)
           
 double getFullDocumentRank(Query Query, Document Document)
           
 KeywordTreeSet getGlobalKeywordTreeSet()
           
 double getInverseDocumentFrequency(int KeywordCount)
           
 double getInverseDocumentFrequency(Keyword Keyword)
          Returns the inverse document frequency Inverse Document Frequency = log2( Number Of Documents divided by the number of times a keyword exists in the Tree Set
 double getInverseDocumentFrequency(java.lang.String KeywordName)
          Returns the inverse document frequency Inverse Document Frequency = log2( Number Of Documents divided by the number of times a keyword exists in the Tree Set
 void setGlobalKeywordTreeSet(KeywordTreeSet GlobalKeywordTreeSet)
           
 
Methods inherited from class java.util.TreeSet
add, addAll, clear, clone, comparator, contains, first, headSet, isEmpty, iterator, last, remove, size, subSet, tailSet
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Field Detail

documentDirectory

public static java.lang.String documentDirectory
Holds the directory of the documents

Constructor Detail

DocumentTreeSet

public DocumentTreeSet()
Initializes the Document Tree Set by reading all the documents held in the document directory

Method Detail

getGlobalKeywordTreeSet

public KeywordTreeSet getGlobalKeywordTreeSet()

setGlobalKeywordTreeSet

public void setGlobalKeywordTreeSet(KeywordTreeSet GlobalKeywordTreeSet)

getDocument

public Document getDocument(java.lang.String DocumentName)
Returns the document with the corresponding document name


getInverseDocumentFrequency

public double getInverseDocumentFrequency(Keyword Keyword)
Returns the inverse document frequency Inverse Document Frequency = log2( Number Of Documents divided by the number of times a keyword exists in the Tree Set


getInverseDocumentFrequency

public double getInverseDocumentFrequency(java.lang.String KeywordName)
Returns the inverse document frequency Inverse Document Frequency = log2( Number Of Documents divided by the number of times a keyword exists in the Tree Set


getInverseDocumentFrequency

public double getInverseDocumentFrequency(int KeywordCount)

getDocumentRank

public double getDocumentRank(Query Query,
                              Document Document)

getAlternateDocumentRank

public double getAlternateDocumentRank(Query Query,
                                       Document Document)
Gets the document rank for the specified query. sum( documentTermWeight * queryTermWeight ) Rank = -------------------------------------------------------------- sqrt(sum(documentTermWeight^2)) * sqrt(sum(queryTermWeight^2))


getFullDocumentRank

public double getFullDocumentRank(Query Query,
                                  Document Document)