lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Parit Bansal <>
Subject WordDelimiterIterator word splitting usecase
Date Fri, 22 Dec 2017 11:51:10 GMT

I have been migrating and maintaining lucene indexing code for our use 
case since 2.x version (now we are are 6.6.1 migrating to 7.x) .

One problem I am constantly facing is regarding 
org.apache.lucene.analysis.miscellaneous.WordDelimiterIterator class 
that is defined final in lucene codebase.  In this class, there is a 
isBreak() method that defines when to split a word into subwords. One of 
the cases is *ALPHA->NUMERIC, NUMERIC->ALPHA :Don't split* (in the same 
if condition) .

Unfortunately, in my use case we strictly want *NUMERIC->ALPHA :Don't 
split* and there is no way around to change this behavior using the 

Since this isBreak() method is private and WordDelimiterFilterIterator 
class final therefore there is no possibility for subclassing and 
overriding this method.

Also, WordDelimiterFilterIterator is tightly coupled with 
WordDelimiterFilter (WordDelimiterGraphFilter in 7.x) and both are 
final. So this leaves me with only one option to copy paste their code 
into custom classes and change the behaviour. Clearly this is not a 
maintainable solution.

So, I am looking for advise what else is possible? OR is there a 
possibility of a patch/refactoring to fix isBreak() to use some new 
configuration flags?

- Best

Parit Bansal


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

View raw message