dragon.ir.index
Class AbstractIndexWriter

java.lang.Object
  |
  +--dragon.ir.index.AbstractIndexWriter
All Implemented Interfaces:
IndexWriter
Direct Known Subclasses:
BasicIndexWriter, OnlineIndexWriter

public abstract class AbstractIndexWriter
extends java.lang.Object
implements IndexWriter

The class implements two methods writing termdoc and docterm matrix to disk with options of term based, relation based or both

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
protected  IRCollection collection
           
protected static int doc_cache_size
           
protected  int doc_in_cache
           
protected  IRDocIndexList docIndexList
           
protected  IntSparseMatrix docrelationMatrix
           
protected  IntSparseMatrix doctermMatrix
           
protected  boolean initialized
           
protected  IRRelationIndexList relationIndexList
           
protected  boolean relationSupported
           
protected  IRTermIndexList termIndexList
           
 
Constructor Summary
AbstractIndexWriter(boolean relationSupported)
           
 
Method Summary
 int size()
           
 boolean write(IRDoc curDoc, IRTerm[] arrTerms)
          All fields (doc key, doc index, term count, term number, relation count, and relation number) of the IRDoc object should be set.
 boolean write(IRDoc curDoc, IRTerm[] arrTerms, IRRelation[] arrRelations)
          All fields (doc key, doc index, term count, term number, relation count, and relation number) of the IRDoc object should be set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dragon.ir.index.IndexWriter
clean, close, flush, initialize
 

Field Detail

doc_cache_size

protected static int doc_cache_size

termIndexList

protected IRTermIndexList termIndexList

relationIndexList

protected IRRelationIndexList relationIndexList

docIndexList

protected IRDocIndexList docIndexList

doctermMatrix

protected IntSparseMatrix doctermMatrix

docrelationMatrix

protected IntSparseMatrix docrelationMatrix

collection

protected IRCollection collection

doc_in_cache

protected int doc_in_cache

relationSupported

protected boolean relationSupported

initialized

protected boolean initialized
Constructor Detail

AbstractIndexWriter

public AbstractIndexWriter(boolean relationSupported)
Method Detail

size

public int size()
Specified by:
size in interface IndexWriter
Returns:
the number of documents indexed.

write

public boolean write(IRDoc curDoc,
                     IRTerm[] arrTerms,
                     IRRelation[] arrRelations)
Description copied from interface: IndexWriter
All fields (doc key, doc index, term count, term number, relation count, and relation number) of the IRDoc object should be set. Fields of IRTerm including term index and term frequency should be set. Fields of IRRelation including relation index, first term, second term, and relation frequency should be set. No duplicated IRTerm or IRRelation is allowed.

Specified by:
write in interface IndexWriter
Parameters:
curDoc - the current document
arrTerms - terms in the current document
arrRelations - relations in the current document
Returns:
true if written successfully

write

public boolean write(IRDoc curDoc,
                     IRTerm[] arrTerms)
Description copied from interface: IndexWriter
All fields (doc key, doc index, term count, term number, relation count, and relation number) of the IRDoc object should be set. Fields of IRTerm including term index and term frequency should be set. No duplicated IRTerm is allowed.

Specified by:
write in interface IndexWriter
Parameters:
curDoc - the current document
arrTerms - terms in the current document
Returns:
true if written successfully