org.apache.lucene.analysis.de
Class WordlistLoader

java.lang.Object
  extended by org.apache.lucene.analysis.de.WordlistLoader

public class WordlistLoader
extends java.lang.Object

Loader for text files that represent a list of stopwords.

Version:
$Id: WordlistLoader.java,v 1.10 2004/03/30 15:54:48 otis Exp $
Author:
Gerhard Schwarz
To Do:
this is not specific to German, it should be moved up

Constructor Summary
WordlistLoader()
           
 
Method Summary
static java.util.HashSet getWordSet(java.io.File wordfile)
          Loads a text file and adds every line as an entry to a HashSet (omitting leading and trailing whitespace).
static java.util.Hashtable getWordtable(java.io.File wordfile)
          Deprecated. Use getWordSet(File) getWordSet(File)} instead
static java.util.Hashtable getWordtable(java.lang.String wordfile)
          Deprecated. Use getWordSet(File) getWordSet(File)} instead
static java.util.Hashtable getWordtable(java.lang.String path, java.lang.String wordfile)
          Deprecated. Use getWordSet(File) getWordSet(File)} instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordlistLoader

public WordlistLoader()
Method Detail

getWordSet

public static java.util.HashSet getWordSet(java.io.File wordfile)
                                    throws java.io.IOException
Loads a text file and adds every line as an entry to a HashSet (omitting leading and trailing whitespace). Every line of the file should contain only one word. The words need to be in lowercase if you make use of an Analyzer which uses LowerCaseFilter (like GermanAnalyzer).

Parameters:
wordfile - File containing the wordlist
Returns:
A HashSet with the file's words
Throws:
java.io.IOException

getWordtable

public static java.util.Hashtable getWordtable(java.lang.String path,
                                               java.lang.String wordfile)
                                        throws java.io.IOException
Deprecated. Use getWordSet(File) getWordSet(File)} instead

Parameters:
path - Path to the wordlist
wordfile - Name of the wordlist
Throws:
java.io.IOException

getWordtable

public static java.util.Hashtable getWordtable(java.lang.String wordfile)
                                        throws java.io.IOException
Deprecated. Use getWordSet(File) getWordSet(File)} instead

Parameters:
wordfile - Complete path to the wordlist
Throws:
java.io.IOException

getWordtable

public static java.util.Hashtable getWordtable(java.io.File wordfile)
                                        throws java.io.IOException
Deprecated. Use getWordSet(File) getWordSet(File)} instead

Parameters:
wordfile - File object that points to the wordlist
Throws:
java.io.IOException


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.