com.bericotech.clavin.index
Class WhitespaceLowerCaseTokenizer

java.lang.Object
  extended by org.apache.lucene.util.AttributeSource
      extended by org.apache.lucene.analysis.TokenStream
          extended by org.apache.lucene.analysis.Tokenizer
              extended by org.apache.lucene.analysis.util.CharTokenizer
                  extended by com.bericotech.clavin.index.WhitespaceLowerCaseTokenizer
All Implemented Interfaces:
Closeable

public class WhitespaceLowerCaseTokenizer
extends org.apache.lucene.analysis.util.CharTokenizer

LowerCaseTokenizer performs the function of WhitespaceTokenizer and LowerCaseFilter together. It divides text at whitespace and converts them to lower case. While it is functionally equivalent to a combination of WhitespaceTokenizer and LowerCaseFilter, there is a performance advantage to doing the two tasks at once, hence this (redundant) implementation.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
org.apache.lucene.util.AttributeSource.AttributeFactory, org.apache.lucene.util.AttributeSource.State
 
Field Summary
 
Fields inherited from class org.apache.lucene.analysis.Tokenizer
input
 
Constructor Summary
WhitespaceLowerCaseTokenizer(org.apache.lucene.util.Version matchVersion, Reader in)
          Call the "super" constructor.
 
Method Summary
protected  boolean isTokenChar(int c)
          Collects only characters which do not satisfy Character.isWhitespace(int).
protected  int normalize(int c)
          Converts char to lower case Character.toLowerCase(int).
 
Methods inherited from class org.apache.lucene.analysis.util.CharTokenizer
end, incrementToken, reset
 
Methods inherited from class org.apache.lucene.analysis.Tokenizer
close, correctOffset, setReader
 
Methods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WhitespaceLowerCaseTokenizer

public WhitespaceLowerCaseTokenizer(org.apache.lucene.util.Version matchVersion,
                                    Reader in)
Call the "super" constructor.

Parameters:
matchVersion - e.g., Version.LUCENE_40
in -
Method Detail

isTokenChar

protected boolean isTokenChar(int c)
Collects only characters which do not satisfy Character.isWhitespace(int).

Specified by:
isTokenChar in class org.apache.lucene.analysis.util.CharTokenizer
Parameters:
c - char being processed

normalize

protected int normalize(int c)
Converts char to lower case Character.toLowerCase(int).

Overrides:
normalize in class org.apache.lucene.analysis.util.CharTokenizer
Parameters:
c - char being processed


Copyright © 2013 Berico Technologies. All rights reserved.