org.dspace.search
Class DSTokenizer

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.CharTokenizer
                  extended by org.dspace.search.DSTokenizer

public final class DSTokenizer
extends org.apache.lucene.analysis.CharTokenizer

Customized Lucene Tokenizer, since the standard one rejects numbers from indexing/querying.


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
DSTokenizer(Reader in)
          Construct a new LowerCaseTokenizer.
 
Method Summary
protected  boolean isTokenChar(char c)
          Collects only characters which do not satisfy Character.isWhitespace(char).
protected  char normalize(char c)
          Collects only characters which satisfy Character.isLetter(char).
 
Methods inherited from class org.apache.lucene.analysis.CharTokenizer
end, incrementToken, next, next, reset
 
Methods inherited from class org.apache.lucene.analysis.Tokenizer
close, correctOffset
 
Methods inherited from class org.apache.lucene.analysis.TokenStream
getOnlyUseNewAPI, reset, setOnlyUseNewAPI
 
Methods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, restoreState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DSTokenizer

public DSTokenizer(Reader in)
Construct a new LowerCaseTokenizer.

Method Detail

normalize

protected char normalize(char c)
Collects only characters which satisfy Character.isLetter(char).

Overrides:
normalize in class org.apache.lucene.analysis.CharTokenizer

isTokenChar

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

Specified by:
isTokenChar in class org.apache.lucene.analysis.CharTokenizer


Copyright © 2011 DuraSpace. All Rights Reserved.