Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase Class Referenceabstract

Inherits Lucene.Net.Analysis.TokenFilter.

Inherited by Lucene.Net.Analysis.Compound.DictionaryCompoundWordTokenFilter.

Public Member Functions

sealed override bool IncrementToken ()
 Consumers (i.e., IndexWriter) use this method to advance the stream to the next token. Implementing classes must implement this method and update the appropriate Util.Attributes with the attributes of the next token.
 
override void Reset ()
 Resets this stream to the beginning. This is an optional operation, so subclasses may or may not implement this method. Reset() is not needed for the standard indexing process. However, if the tokens of a TokenStream are intended to be consumed more than once, it is necessary to implement Reset(). Note that if your TokenStream caches tokens and feeds them back again after a reset, it is imperative that you clone the tokens when you store them away (on the first pass) as well as when you return them (on future passes after Reset()).
 
- Public Member Functions inherited from Lucene.Net.Analysis.TokenFilter
override void End ()
 Performs end-of-stream operations, if any, and calls then end() on the input TokenStream.NOTE: Be sure to call super.end() first when overriding this method.
 
override void Reset ()
 Reset the filter as well as the input TokenStream.
 
- Public Member Functions inherited from Lucene.Net.Analysis.TokenStream
void Close ()
 Releases resources associated with this stream.
 
void Dispose ()
 
- Public Member Functions inherited from Lucene.Net.Util.AttributeSource
 AttributeSource ()
 An AttributeSource using the default attribute factory AttributeSource.AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY.
 
 AttributeSource (AttributeSource input)
 An AttributeSource that uses the same attributes as the supplied one.
 
 AttributeSource (AttributeFactory factory)
 An AttributeSource using the supplied AttributeFactory for creating new IAttribute instances.
 
virtual IEnumerable< Type > GetAttributeTypesIterator ()
 Returns a new iterator that iterates the attribute classes in the same order they were added in. Signature for Java 1.5: public Iterator<Class<? extends Attribute>> getAttributeClassesIterator()
 
virtual IEnumerable< AttributeGetAttributeImplsIterator ()
 Returns a new iterator that iterates all unique Attribute implementations. This iterator may contain less entries that GetAttributeTypesIterator, if one instance implements more than one Attribute interface. Signature for Java 1.5: public Iterator<AttributeImpl> getAttributeImplsIterator()
 
virtual void AddAttributeImpl (Attribute att)
 Expert: Adds a custom AttributeImpl instance with one or more Attribute interfaces.
 
virtual T AddAttribute< T > ()
 The caller must pass in a Class<? extends Attribute> value. This method first checks if an instance of that class is already in this AttributeSource and returns it. Otherwise a new instance is created, added to this AttributeSource and returned.
 
virtual bool HasAttribute< T > ()
 The caller must pass in a Class<? extends Attribute> value. Returns true, iff this AttributeSource contains the passed-in Attribute.
 
virtual T GetAttribute< T > ()
 The caller must pass in a Class<? extends Attribute> value. Returns the instance of the passed in Attribute contained in this AttributeSource
 
virtual void ClearAttributes ()
 Resets all Attributes in this AttributeSource by calling Attribute.Clear() on each Attribute implementation.
 
virtual State CaptureState ()
 Captures the state of all Attributes. The return value can be passed to RestoreState to restore the state of this or another AttributeSource.
 
virtual void RestoreState (State state)
 Restores this state by copying the values of all attribute implementations that this state contains into the attributes implementations of the targetStream. The targetStream must contain a corresponding instance for each argument contained in this state (e.g. it is not possible to restore the state of an AttributeSource containing a TermAttribute into a AttributeSource using a Token instance as implementation).
 
override int GetHashCode ()
 
override bool Equals (System.Object obj)
 
override System.String ToString ()
 
virtual AttributeSource CloneAttributes ()
 Performs a clone of all Attribute instances returned in a new AttributeSource instance. This method can be used to e.g. create another TokenStream with exactly the same attributes (using AttributeSource(AttributeSource))
 

Static Public Member Functions

static ISet< string > MakeDictionary (String[] dictionary)
 

Static Public Attributes

static readonly int DEFAULT_MIN_WORD_SIZE = 5
 
static readonly int DEFAULT_MIN_SUBWORD_SIZE = 2
 
static readonly int DEFAULT_MAX_SUBWORD_SIZE = 15
 

Protected Member Functions

 CompoundWordTokenFilterBase (TokenStream input, String[] dictionary, int minWordSize, int minSubwordSize, int maxSubwordSize, bool onlyLongestMatch)
 
 CompoundWordTokenFilterBase (TokenStream input, String[] dictionary, bool onlyLongestMatch)
 
 CompoundWordTokenFilterBase (TokenStream input, ISet< string > dictionary, bool onlyLongestMatch)
 
 CompoundWordTokenFilterBase (TokenStream input, String[] dictionary)
 
 CompoundWordTokenFilterBase (TokenStream input, ISet< string > dictionary)
 
 CompoundWordTokenFilterBase (TokenStream input, ISet< string > dictionary, int minWordSize, int minSubwordSize, int maxSubwordSize, bool onlyLongestMatch)
 
Token CreateToken (int offset, int length, Token prototype)
 
void Decompose (Token token)
 
abstract void DecomposeInternal (Token token)
 
- Protected Member Functions inherited from Lucene.Net.Analysis.TokenFilter
override void Dispose (bool disposing)
 

Static Protected Member Functions

static void AddAllLowerCase (ISet< string > target, ICollection< string > col)
 
static char[] MakeLowerCaseCopy (char[] buffer)
 

Protected Attributes

readonly CharArraySet dictionary
 
readonly LinkedList< Tokentokens
 
readonly int minWordSize
 
readonly int minSubwordSize
 
readonly int maxSubwordSize
 
readonly bool onlyLongestMatch
 

Additional Inherited Members

- Properties inherited from Lucene.Net.Util.AttributeSource
virtual AttributeFactory Factory [get]
 Returns the used AttributeFactory.
 
virtual bool HasAttributes [get]
 Returns true, iff this AttributeSource has any attributes
 

Detailed Description

Definition at line 28 of file CompoundWordTokenFilterBase.cs.

Constructor & Destructor Documentation

Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.CompoundWordTokenFilterBase ( TokenStream  input,
String[]  dictionary,
int  minWordSize,
int  minSubwordSize,
int  maxSubwordSize,
bool  onlyLongestMatch 
)
protected

Definition at line 61 of file CompoundWordTokenFilterBase.cs.

Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.CompoundWordTokenFilterBase ( TokenStream  input,
String[]  dictionary,
bool  onlyLongestMatch 
)
protected

Definition at line 67 of file CompoundWordTokenFilterBase.cs.

Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.CompoundWordTokenFilterBase ( TokenStream  input,
ISet< string >  dictionary,
bool  onlyLongestMatch 
)
protected

Definition at line 73 of file CompoundWordTokenFilterBase.cs.

Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.CompoundWordTokenFilterBase ( TokenStream  input,
String[]  dictionary 
)
protected

Definition at line 79 of file CompoundWordTokenFilterBase.cs.

Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.CompoundWordTokenFilterBase ( TokenStream  input,
ISet< string >  dictionary 
)
protected

Definition at line 85 of file CompoundWordTokenFilterBase.cs.

Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.CompoundWordTokenFilterBase ( TokenStream  input,
ISet< string >  dictionary,
int  minWordSize,
int  minSubwordSize,
int  maxSubwordSize,
bool  onlyLongestMatch 
)
protected

Definition at line 91 of file CompoundWordTokenFilterBase.cs.

Member Function Documentation

static void Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.AddAllLowerCase ( ISet< string >  target,
ICollection< string >  col 
)
staticprotected

Definition at line 178 of file CompoundWordTokenFilterBase.cs.

Token Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.CreateToken ( int  offset,
int  length,
Token  prototype 
)
protected

Definition at line 199 of file CompoundWordTokenFilterBase.cs.

void Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.Decompose ( Token  token)
protected

Definition at line 208 of file CompoundWordTokenFilterBase.cs.

abstract void Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.DecomposeInternal ( Token  token)
protectedpure virtual
sealed override bool Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.IncrementToken ( )
virtual

Consumers (i.e., IndexWriter) use this method to advance the stream to the next token. Implementing classes must implement this method and update the appropriate Util.Attributes with the attributes of the next token.

The producer must make no assumptions about the attributes after the method has been returned: the caller may arbitrarily change it. If the producer needs to preserve the state for subsequent calls, it can use AttributeSource.CaptureState to create a copy of the current attribute state.

This method is called for every token of a document, so an efficient implementation is crucial for good performance. To avoid calls to AttributeSource.AddAttribute{T}() and AttributeSource.GetAttribute{T}(), references to all Util.Attributes that this stream uses should be retrieved during instantiation.

To ensure that filters and consumers know which attributes are available, the attributes must be added during instantiation. Filters and consumers are not required to check for availability of attributes in IncrementToken().

Returns
false for end of stream; true otherwise

Implements Lucene.Net.Analysis.TokenStream.

Definition at line 144 of file CompoundWordTokenFilterBase.cs.

static ISet<string> Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.MakeDictionary ( String[]  dictionary)
static

Definition at line 125 of file CompoundWordTokenFilterBase.cs.

static char [] Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.MakeLowerCaseCopy ( char[]  buffer)
staticprotected

Definition at line 186 of file CompoundWordTokenFilterBase.cs.

override void Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.Reset ( )
virtual

Resets this stream to the beginning. This is an optional operation, so subclasses may or may not implement this method. Reset() is not needed for the standard indexing process. However, if the tokens of a TokenStream are intended to be consumed more than once, it is necessary to implement Reset(). Note that if your TokenStream caches tokens and feeds them back again after a reset, it is imperative that you clone the tokens when you store them away (on the first pass) as well as when you return them (on future passes after Reset()).

Reimplemented from Lucene.Net.Analysis.TokenStream.

Definition at line 224 of file CompoundWordTokenFilterBase.cs.

Member Data Documentation

readonly int Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE = 15
static

Definition at line 43 of file CompoundWordTokenFilterBase.cs.

readonly int Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE = 2
static

Definition at line 38 of file CompoundWordTokenFilterBase.cs.

readonly int Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE = 5
static

Definition at line 33 of file CompoundWordTokenFilterBase.cs.

readonly CharArraySet Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.dictionary
protected

Definition at line 45 of file CompoundWordTokenFilterBase.cs.

readonly int Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.maxSubwordSize
protected

Definition at line 49 of file CompoundWordTokenFilterBase.cs.

readonly int Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.minSubwordSize
protected

Definition at line 48 of file CompoundWordTokenFilterBase.cs.

readonly int Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.minWordSize
protected

Definition at line 47 of file CompoundWordTokenFilterBase.cs.

readonly bool Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.onlyLongestMatch
protected

Definition at line 50 of file CompoundWordTokenFilterBase.cs.

readonly LinkedList<Token> Lucene.Net.Analysis.Compound.CompoundWordTokenFilterBase.tokens
protected

Definition at line 46 of file CompoundWordTokenFilterBase.cs.


The documentation for this class was generated from the following file: