net.sf.zekr.engine.search.lucene
Class ArabicAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by net.sf.zekr.engine.search.lucene.ArabicAnalyzer

public class ArabicAnalyzer
extends org.apache.lucene.analysis.Analyzer

Filters StandardTokenizer with ArabicFilter, and StopFilter using a list of Arabic stop words.

Author:
Mohsen Saboorian

Field Summary
static java.lang.String[] STOP_WORDS
          An array containing some common English words that are usually not useful for searching.
 
Constructor Summary
ArabicAnalyzer()
          Builds an analyzer with the default stop words (STOP_WORDS).
ArabicAnalyzer(java.io.File stopwords)
          Builds an analyzer with the stop words from the given file.
ArabicAnalyzer(java.io.Reader stopwords)
          Builds an analyzer with the stop words from the given reader.
ArabicAnalyzer(java.util.Set stopWords)
          Builds an analyzer with the given stop words.
ArabicAnalyzer(java.lang.String[] stopWords)
          Builds an analyzer with the given stop words.
 
Method Summary
 org.apache.lucene.analysis.TokenStream tokenStream(java.lang.String fieldName, java.io.Reader reader)
          Constructs a StandardTokenizer filtered by a ArabicFilter and a StopFilter.
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
getPositionIncrementGap, getPreviousTokenStream, reusableTokenStream, setPreviousTokenStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STOP_WORDS

public static final java.lang.String[] STOP_WORDS
An array containing some common English words that are usually not useful for searching.

Constructor Detail

ArabicAnalyzer

public ArabicAnalyzer()
Builds an analyzer with the default stop words (STOP_WORDS).


ArabicAnalyzer

public ArabicAnalyzer(java.util.Set stopWords)
Builds an analyzer with the given stop words.


ArabicAnalyzer

public ArabicAnalyzer(java.lang.String[] stopWords)
Builds an analyzer with the given stop words.


ArabicAnalyzer

public ArabicAnalyzer(java.io.File stopwords)
               throws java.io.IOException
Builds an analyzer with the stop words from the given file.

Throws:
java.io.IOException
See Also:
WordlistLoader.getWordSet(File)

ArabicAnalyzer

public ArabicAnalyzer(java.io.Reader stopwords)
               throws java.io.IOException
Builds an analyzer with the stop words from the given reader.

Throws:
java.io.IOException
See Also:
WordlistLoader.getWordSet(Reader)
Method Detail

tokenStream

public org.apache.lucene.analysis.TokenStream tokenStream(java.lang.String fieldName,
                                                          java.io.Reader reader)
Constructs a StandardTokenizer filtered by a ArabicFilter and a StopFilter.

Specified by:
tokenStream in class org.apache.lucene.analysis.Analyzer