lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Renaud Delbru (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4642) TokenizerFactory should provide a create method with a given AttributeSource
Date Sun, 27 Jan 2013 11:45:14 GMT


Renaud Delbru commented on LUCENE-4642:

Hi Robert,

I understand your point of view. One possible alternative for simplifying the API would be
to refactor constructors with AttributeSource/AttributeFactory into setters. After a quick
look, this looks compatible with the existing tokenizers and tokenizer factories. 
The setting of AttributeSource/AttributeFactory for a tokenizer will be transparent (i.e.,
they do not have to explicitly create a constructor), and specific extension can be still
implemented by subclasses (e.g., NumericTokenStream can overwrite the setAttributeFactory
method to wrap a given factory with NumericAttributeFactory).
For the tokenizer factories, we can then implement a create method with an AttributeSource/AttributeFactory
parameter, which will call the abstract method create and then call the setAttributeSource/setAttributeFactory
on the newly created tokenizer.

What do you think ? Did I miss something in my reasoning which could break something ? 
> TokenizerFactory should provide a create method with a given AttributeSource
> ----------------------------------------------------------------------------
>                 Key: LUCENE-4642
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/analysis
>    Affects Versions: 4.1
>            Reporter: Renaud Delbru
>            Assignee: Steve Rowe
>              Labels: analysis, attribute, tokenizer
>             Fix For: 4.2, 5.0
>         Attachments: LUCENE-4642.patch, LUCENE-4642.patch
> All tokenizer implementations have a constructor that takes a given AttributeSource as
parameter (LUCENE-1826). However, the TokenizerFactory does not provide an API to create tokenizers
with a given AttributeSource.
> Side note: There are still a lot of tokenizers that do not provide constructors that
take AttributeSource and AttributeFactory.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message