|
| StandardTokenizer (LuceneVersion::Version matchVersion, const ReaderPtr &input) |
| Creates a new instance of the StandardTokenizer . Attaches the input to the newly created scanner.
|
|
| StandardTokenizer (LuceneVersion::Version matchVersion, const AttributeSourcePtr &source, const ReaderPtr &input) |
| Creates a new StandardTokenizer with a given AttributeSource .
|
|
| StandardTokenizer (LuceneVersion::Version matchVersion, const AttributeFactoryPtr &factory, const ReaderPtr &input) |
| Creates a new StandardTokenizer with a given AttributeSource.AttributeFactory .
|
|
virtual | ~StandardTokenizer () |
|
virtual String | getClassName () |
|
boost::shared_ptr< StandardTokenizer > | shared_from_this () |
|
void | setMaxTokenLength (int32_t length) |
| Set the max allowed token length. Any token longer than this is skipped.
|
|
int32_t | getMaxTokenLength () |
|
virtual bool | incrementToken () |
|
virtual void | end () |
| This method is called by the consumer after the last token has been consumed, after incrementToken() returned false (using the new TokenStream API). Streams implementing the old API should upgrade to use this feature.
|
|
virtual void | reset (const ReaderPtr &input) |
| Reset the tokenizer to a new reader. Typically, an analyzer (in its reusableTokenStream method) will use this to re-use a previously created tokenizer.
|
|
bool | isReplaceInvalidAcronym () |
|
void | setReplaceInvalidAcronym (bool replaceInvalidAcronym) |
|
virtual | ~Tokenizer () |
|
boost::shared_ptr< Tokenizer > | shared_from_this () |
|
virtual void | close () |
| By default, closes the input Reader.
|
|
virtual int32_t | correctOffset (int32_t currentOff) |
| Return the corrected offset. If input is a CharStream subclass this method calls CharStream#correctOffset , else returns currentOff.
|
|
virtual 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() ).
|
|
virtual | ~TokenStream () |
|
boost::shared_ptr< TokenStream > | shared_from_this () |
|
| AttributeSource () |
| An AttributeSource using the default attribute factory DefaultAttributeFactory .
|
|
| AttributeSource (const AttributeSourcePtr &input) |
| An AttributeSource that uses the same attributes as the supplied one.
|
|
| AttributeSource (const AttributeFactoryPtr &factory) |
| An AttributeSource using the supplied AttributeFactory for creating new Attribute instances.
|
|
virtual | ~AttributeSource () |
|
boost::shared_ptr< AttributeSource > | shared_from_this () |
|
AttributeFactoryPtr | getAttributeFactory () |
| returns the used AttributeFactory.
|
|
template<class ATTR > |
boost::shared_ptr< ATTR > | addAttribute () |
| 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.
|
|
void | addAttribute (const String &className, const AttributePtr &attrImpl) |
| Adds a custom Attribute instance.
|
|
bool | hasAttributes () |
| Returns true if this AttributeSource has any attributes.
|
|
template<class ATTR > |
bool | hasAttribute () |
| Returns true, if this AttributeSource contains the passed-in Attribute.
|
|
template<class ATTR > |
boost::shared_ptr< ATTR > | getAttribute () |
| Returns the instance of the passed in Attribute contained in this AttributeSource.
|
|
void | clearAttributes () |
| Resets all Attributes in this AttributeSource by calling AttributeImpl#clear() on each Attribute implementation.
|
|
AttributeSourceStatePtr | captureState () |
| Captures the state of all Attributes. The return value can be passed to restoreState to restore the state of this or another AttributeSource.
|
|
void | restoreState (const AttributeSourceStatePtr &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 (eg. it is not possible to restore the state of an AttributeSource containing a TermAttribute into a AttributeSource using a Token instance as implementation).
|
|
virtual int32_t | hashCode () |
| Return hash code for this object.
|
|
virtual bool | equals (const LuceneObjectPtr &other) |
| Return whether two objects are equal.
|
|
virtual String | toString () |
| Returns a string representation of the object.
|
|
AttributeSourcePtr | cloneAttributes () |
| Performs a clone of all AttributeImpl instances returned in a new AttributeSource instance. This method can be used to eg. create another TokenStream with exactly the same attributes (using AttributeSource(AttributeSource) )
|
|
Collection< AttributePtr > | getAttributes () |
| Return a vector of attributes based on currentState.
|
|
virtual | ~LuceneObject () |
|
virtual void | initialize () |
| Called directly after instantiation to create objects that depend on this object being fully constructed.
|
|
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
| Return clone of this object.
|
|
virtual int32_t | compareTo (const LuceneObjectPtr &other) |
| Compare two objects.
|
|
virtual | ~LuceneSync () |
|
virtual SynchronizePtr | getSync () |
| Return this object synchronize lock.
|
|
virtual LuceneSignalPtr | getSignal () |
| Return this object signal.
|
|
virtual void | lock (int32_t timeout=0) |
| Lock this object using an optional timeout.
|
|
virtual void | unlock () |
| Unlock this object.
|
|
virtual bool | holdsLock () |
| Returns true if this object is currently locked by current thread.
|
|
virtual void | wait (int32_t timeout=0) |
| Wait for signal using an optional timeout.
|
|
virtual void | notifyAll () |
| Notify all threads waiting for signal.
|
|
A grammar-based tokenizer.
This should be a good tokenizer for most European-language documents:
-
Splits words at punctuation characters, removing punctuation. However, a dot that's not followed by whitespace is considered part of a token.
-
Splits words at hyphens, unless there's a number in the token, in which case the whole token is interpreted as a product number and is not split.
-
Recognizes email addresses and internet hostnames as one token.
Many applications have specific tokenizer needs. If this tokenizer does not suit your application, please consider copying this source code directory to your project and maintaining your own grammar-based tokenizer.
You must specify the required Version
compatibility when creating StandardAnalyzer:
-
As of 2.4, Tokens incorrectly identified as acronyms are corrected