dragon.ir.index.sentence
Class AbstractSentenceIndexer

java.lang.Object
  |
  +--dragon.ir.index.sentence.AbstractSentenceIndexer
All Implemented Interfaces:
Indexer
Direct Known Subclasses:
BasicSentenceIndexer, DualSentenceIndexer, OnlineSentenceIndexer

public abstract class AbstractSentenceIndexer
extends java.lang.Object
implements Indexer

The abstract indexder for sentence level indexing

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
protected  boolean initialized
           
protected  DocumentParser parser
           
 
Constructor Summary
AbstractSentenceIndexer(DocumentParser parser)
           
 
Method Summary
 void close()
          This method releases occupied resources.
protected  Document getDocument(Article article)
           
 int getMinSentenceLength()
           
protected  java.lang.String getSentenceKey(java.lang.String docKey, int sentIndex)
           
 boolean index(Article article)
          An article has many sections such as title, abstract and body.
abstract  boolean index(Sentence sent, java.lang.String sentKey)
           
 boolean indexed(java.lang.String docKey)
           
 boolean screenArticleContent(boolean useTitle, boolean useAbstract, boolean useBody)
           
 void setLog(java.lang.String logFile)
           
 void setMinSentenceLength(int minLength)
           
protected  void writeLog(java.lang.String content)
           
 
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.Indexer
initialize
 

Field Detail

initialized

protected boolean initialized

parser

protected DocumentParser parser
Constructor Detail

AbstractSentenceIndexer

public AbstractSentenceIndexer(DocumentParser parser)
Method Detail

index

public abstract boolean index(Sentence sent,
                              java.lang.String sentKey)

setMinSentenceLength

public void setMinSentenceLength(int minLength)

getMinSentenceLength

public int getMinSentenceLength()

screenArticleContent

public boolean screenArticleContent(boolean useTitle,
                                    boolean useAbstract,
                                    boolean useBody)

setLog

public void setLog(java.lang.String logFile)
Specified by:
setLog in interface Indexer

indexed

public boolean indexed(java.lang.String docKey)
Specified by:
indexed in interface Indexer
Parameters:
docKey - the unique document entry number
Returns:
true if this document has been indexed

index

public boolean index(Article article)
Description copied from interface: Indexer
An article has many sections such as title, abstract and body. The selection of sections for indexing is subject to the implemented indexers.

Specified by:
index in interface Indexer
Parameters:
article - the article for indexing
Returns:
true if indexed successfully

getDocument

protected Document getDocument(Article article)

getSentenceKey

protected java.lang.String getSentenceKey(java.lang.String docKey,
                                          int sentIndex)

writeLog

protected void writeLog(java.lang.String content)

close

public void close()
Description copied from interface: Indexer
This method releases occupied resources.

Specified by:
close in interface Indexer