Adding TokenFilters to a CustomAnalyzer is too inflexible

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Adding TokenFilters to a CustomAnalyzer is too inflexible

Nicolás Lichtmaier
I'm using a CustomAnalyzer.Builder to set up an analyzer. I now would
like to add synonym processing, I already have the SynonymMap in memory.
But the builder interface only takes String arguments. Wouldn't it be a
good thing to add a method to CustomAnalyzer.Builder to add a
TokenFilter object already constructed, instead of only being able to
pass a class name? That is: overload the addTokenFilter method to do
this: builder.addTokenizer(new MyTokenFilter(....));

Am I missing something?

Should I create a patch with this minor modification and send it?

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Adding TokenFilters to a CustomAnalyzer is too inflexible

Uwe Schindler
A TokenFilter object already build won't work, because the Analyzer must create new instances of the TokenFilters as needed.

Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: [hidden email]

> -----Original Message-----
> From: Nicolás Lichtmaier [mailto:[hidden email]]
> Sent: Wednesday, March 29, 2017 7:00 PM
> To: [hidden email]
> Subject: Adding TokenFilters to a CustomAnalyzer is too inflexible
>
> I'm using a CustomAnalyzer.Builder to set up an analyzer. I now would
> like to add synonym processing, I already have the SynonymMap in memory.
> But the builder interface only takes String arguments. Wouldn't it be a
> good thing to add a method to CustomAnalyzer.Builder to add a
> TokenFilter object already constructed, instead of only being able to
> pass a class name? That is: overload the addTokenFilter method to do
> this: builder.addTokenizer(new MyTokenFilter(....));
>
> Am I missing something?
>
> Should I create a patch with this minor modification and send it?
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding TokenFilters to a CustomAnalyzer is too inflexible

Nicolás Lichtmaier
Ok, so a flexible interface would be to be able to pass some
TokenFilterFactory that would be called each time a TokenFilter is
needed. Would that be ok?


El 30/03/17 a las 03:47, Uwe Schindler escribió:

> A TokenFilter object already build won't work, because the Analyzer must create new instances of the TokenFilters as needed.
>
> Uwe
>
> -----
> Uwe Schindler
> Achterdiek 19, D-28357 Bremen
> http://www.thetaphi.de
> eMail: [hidden email]
>
>> -----Original Message-----
>> From: Nicolás Lichtmaier [mailto:[hidden email]]
>> Sent: Wednesday, March 29, 2017 7:00 PM
>> To: [hidden email]
>> Subject: Adding TokenFilters to a CustomAnalyzer is too inflexible
>>
>> I'm using a CustomAnalyzer.Builder to set up an analyzer. I now would
>> like to add synonym processing, I already have the SynonymMap in memory.
>> But the builder interface only takes String arguments. Wouldn't it be a
>> good thing to add a method to CustomAnalyzer.Builder to add a
>> TokenFilter object already constructed, instead of only being able to
>> pass a class name? That is: overload the addTokenFilter method to do
>> this: builder.addTokenizer(new MyTokenFilter(....));
>>
>> Am I missing something?
>>
>> Should I create a patch with this minor modification and send it?
>>
>> Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...