[
https://issues.apache.org/jira/browse/LUCENE-4642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13600573#comment-13600573
]
Steve Rowe edited comment on LUCENE-4642 at 3/12/13 10:34 PM:
--------------------------------------------------------------
I haven't resolved this issue because of Robert's response to Renaud:
{quote}
bq. in order not to break existing factories, I think it would be better to
make this new method throw UOE by default instead of being abstract.
I don't agree with this for trunk. we should add deprecations or whatever in
4.x, but trunk should be clean without any UOEs.
{quote}
{{TokenizerFactory.create(AttributeFactory,Reader)}} throws UOE, for those
subclasses that don't override because the corresponding Tokenizer doesn't have
a constructor that takes an AttributeFactory.
I guess the way forward (trunk and branch_4x, I think) is to make this method
abstract and add implementations to all subclasses that don't already have one,
after first adding AttributeFactory-accepting constructors to all Tokenizers
that don't already have them?
was (Author: steve_rowe):
I haven't resolved this issue because of Robert's response to Renaud:
{quote}
bq. in order not to break existing factories, I think it would be better to
make this new method throw UOE by default instead of being abstract.
I don't agree with this for trunk. we should add deprecations or whatever in
4.x, but trunk should be clean without any UOEs.
{quote}
{{TokenizerFactory.create(AttributeFactory,Reader)}} throws UOE, for those
subclasses that don't override because the corresponding Tokenizer doesn't have
a constructor that takes an AttributeFactory.
I guess the way forward (trunk and branch_4x, I think) is to make this method
abstract add implementations to all subclasses that don't already have one,
after first adding AttributeFactory-accepting constructors to all Tokenizers
that don't already have them?
> Add create(AttributeFactory) to TokenizerFactory and subclasses with ctors
> taking AttributeFactory, and remove Tokenizer's and subclasses' ctors taking
> AttributeSource
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: LUCENE-4642
> URL: https://issues.apache.org/jira/browse/LUCENE-4642
> 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.3
>
> Attachments: LUCENE-4642.patch, LUCENE-4642.patch, LUCENE-4642.patch,
> LUCENE-4642.patch, TrieTokenizerFactory.java.patch
>
>
> All tokenizer implementations have a constructor that takes a given
> AttributeSource as parameter (LUCENE-1826). These should be removed.
> TokenizerFactory does not provide an API to create tokenizers with a given
> AttributeFactory, but quite a few tokenizers have constructors that take an
> AttributeFactory. TokenizerFactory should add a create(AttributeFactory)
> method, as should subclasses for tokenizers with AttributeFactory accepting
> ctors.
--
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: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]