gate.creole.annic.apache.lucene.index
Class DocumentWriter

java.lang.Object
  extended by gate.creole.annic.apache.lucene.index.DocumentWriter

final class DocumentWriter
extends Object


Field Summary
private  Analyzer analyzer
           
private  Directory directory
           
private  float[] fieldBoosts
           
private  FieldInfos fieldInfos
           
private  int[] fieldLengths
           
private  int[] fieldPositions
           
private  int maxFieldLength
           
private  Hashtable postingTable
           
private  Similarity similarity
           
private  Term termBuffer
           
 
Constructor Summary
DocumentWriter(Directory directory, Analyzer analyzer, Similarity similarity, int maxFieldLength)
           
 
Method Summary
(package private)  void addDocument(String segment, Document doc)
           
private  void addPosition(String field, String text, String type, int position)
           
private  void invertDocument(Document doc)
           
private static void quickSort(Posting[] postings, int lo, int hi)
           
private  Posting[] sortPostingTable()
           
private  void writeNorms(Document doc, String segment)
           
private  void writePostings(Posting[] postings, String segment)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

analyzer

private Analyzer analyzer

directory

private Directory directory

similarity

private Similarity similarity

fieldInfos

private FieldInfos fieldInfos

maxFieldLength

private int maxFieldLength

postingTable

private final Hashtable postingTable

fieldLengths

private int[] fieldLengths

fieldPositions

private int[] fieldPositions

fieldBoosts

private float[] fieldBoosts

termBuffer

private final Term termBuffer
Constructor Detail

DocumentWriter

DocumentWriter(Directory directory,
               Analyzer analyzer,
               Similarity similarity,
               int maxFieldLength)
Parameters:
directory - The directory to write the document information to
analyzer - The analyzer to use for the document
similarity - The Similarity function
maxFieldLength - The maximum number of tokens a field may have
Method Detail

addDocument

final void addDocument(String segment,
                       Document doc)
                throws IOException
Throws:
IOException

invertDocument

private final void invertDocument(Document doc)
                           throws IOException
Throws:
IOException

addPosition

private final void addPosition(String field,
                               String text,
                               String type,
                               int position)

sortPostingTable

private final Posting[] sortPostingTable()

quickSort

private static final void quickSort(Posting[] postings,
                                    int lo,
                                    int hi)

writePostings

private final void writePostings(Posting[] postings,
                                 String segment)
                          throws IOException
Throws:
IOException

writeNorms

private final void writeNorms(Document doc,
                              String segment)
                       throws IOException
Throws:
IOException