org.cdlib.xtf.textIndexer
Class IdxTreeDictMaker

Object
  extended by IdxTreeDictMaker

public class IdxTreeDictMaker
extends Object

This class provides a simple mechanism for generating a spelling correction dictionary after new documents have been added or updated.

To use this class, simply instantiate a copy, and call the processDir() method on a directory containing an index. Note that the directory passed may also be a root directory with many index sub-directories if desired.


Constructor Summary
IdxTreeDictMaker()
           
 
Method Summary
 void makeDict(File mainIdxDir)
          Performs the actual work of creating a spelling dictionary.
 void processDir(File dir)
          Create an IdxTreeDictMaker instance and call this method to create spelling dictionaries for one or more Lucene indices.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdxTreeDictMaker

public IdxTreeDictMaker()
Method Detail

processDir

public void processDir(File dir)
                throws Exception
Create an IdxTreeDictMaker instance and call this method to create spelling dictionaries for one or more Lucene indices.

Parameters:
dir - The index database directory to scan. May be a directory containing a single index, or the root directory of a tree containing multiple indices.

Throws:
Exception
Notes:
This method also calls itself recursively to process potential index sub-directories below the passed directory.

makeDict

public void makeDict(File mainIdxDir)
              throws Exception
Performs the actual work of creating a spelling dictionary.

Parameters:
mainIdxDir - The index database directory to scan. This directory must contain a single Lucene index.

Throws:
Exception - Passes back any exceptions generated by Lucene during the dictionary generation process.