anl.aida.core
Class STCBuilder

java.lang.Object
  extended by anl.aida.core.STCBuilder

public class STCBuilder
extends java.lang.Object

Builds an ScoredTermsCollection given MIFSTerms and Documents.


Nested Class Summary
private static class STCBuilder.DIDIterator
           
private static class STCBuilder.DocScores
           
private static class STCBuilder.DSArrayIter
           
private static class STCBuilder.FreqScore
           
private static class STCBuilder.STCollection
           
private static class STCBuilder.TermImpl
           
 
Field Summary
private  STCBuilder.STCollection collection
           
private  java.util.List<STCBuilder.TermImpl> termList
           
private  java.util.Map<java.lang.String,java.lang.Integer> termMap
           
 
Constructor Summary
STCBuilder(DateRange range)
           
 
Method Summary
 void addDocument(int docId, java.lang.String title, java.lang.String path)
           
 void addScore(int docId, int termIndex, int freq, float score)
          Adds a score for the specified doc and term.
 java.lang.Integer addTerm(java.lang.String termText)
           
 java.lang.Integer addTerm(java.lang.String termText, int docCount, int minFreq, int maxFreq, float minScore, float maxScore)
           
 ScoredTermsCollection createSTC(boolean calculateTermStats)
           
 boolean hasDocument(int docId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collection

private STCBuilder.STCollection collection

termList

private java.util.List<STCBuilder.TermImpl> termList

termMap

private java.util.Map<java.lang.String,java.lang.Integer> termMap
Constructor Detail

STCBuilder

public STCBuilder(DateRange range)
Method Detail

createSTC

public ScoredTermsCollection createSTC(boolean calculateTermStats)
                                throws AIDAException
Throws:
AIDAException

addScore

public void addScore(int docId,
                     int termIndex,
                     int freq,
                     float score)
Adds a score for the specified doc and term. If the term already has a score for that doc, then the results are added together.

Parameters:
docId -
termIndex -
freq -
score -

hasDocument

public boolean hasDocument(int docId)

addDocument

public void addDocument(int docId,
                        java.lang.String title,
                        java.lang.String path)
                 throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

addTerm

public java.lang.Integer addTerm(java.lang.String termText,
                                 int docCount,
                                 int minFreq,
                                 int maxFreq,
                                 float minScore,
                                 float maxScore)

addTerm

public java.lang.Integer addTerm(java.lang.String termText)