comirva.web.ie.countryoforigin
Class CountryOfOriginAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by comirva.web.ie.countryoforigin.CountryOfOriginAnalyzer
All Implemented Interfaces:
Closeable

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

A lucence word analyzer tailored to the use in AGMIS.


Field Summary
static int DEFAULT_MAX_TOKEN_LENGTH
          Default maximum allowed token length
static String[] includeWords
           
 
Fields inherited from class org.apache.lucene.analysis.Analyzer
overridesTokenStreamMethod
 
Constructor Summary
CountryOfOriginAnalyzer()
          Builds an analyzer with no stop words.
CountryOfOriginAnalyzer(String dictionaryFile)
          Builds an analyzer with no stop words.
 
Method Summary
 int getMaxTokenLength()
           
 void setMaxTokenLength(int length)
          Set maximum allowed token length.
 org.apache.lucene.analysis.TokenStream tokenStream(String fieldName, Reader reader)
           
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, reusableTokenStream, setOverridesTokenStreamMethod, setPreviousTokenStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_TOKEN_LENGTH

public static final int DEFAULT_MAX_TOKEN_LENGTH
Default maximum allowed token length

See Also:
Constant Field Values

includeWords

public static String[] includeWords
Constructor Detail

CountryOfOriginAnalyzer

public CountryOfOriginAnalyzer()
Builds an analyzer with no stop words.


CountryOfOriginAnalyzer

public CountryOfOriginAnalyzer(String dictionaryFile)
Builds an analyzer with no stop words.

Method Detail

tokenStream

public org.apache.lucene.analysis.TokenStream tokenStream(String fieldName,
                                                          Reader reader)
Specified by:
tokenStream in class org.apache.lucene.analysis.Analyzer

setMaxTokenLength

public void setMaxTokenLength(int length)
Set maximum allowed token length. If a token is seen that exceeds this length then it is discarded. This setting only takes effect the next time tokenStream or reusableTokenStream is called.


getMaxTokenLength

public int getMaxTokenLength()
See Also:
setMaxTokenLength(int)