You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2011/08/31 18:07:09 UTC

[jira] [Commented] (LUCENE-3410) Make WordDelimiterFilter's instantiation more readable

    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13094641#comment-13094641 ] 

Robert Muir commented on LUCENE-3410:
-------------------------------------

I think flags is a good solution here, its very simple and will improve readability: the backwards compat is obvious too.

I think its a bit scary to use enumset, it will involve complicated generics and the jdk itself does not seem to use enumset anywhere!
e.g. Pattern.compile(String regex, int flags)

I think a builder is overkill here, if someone wants a builder they can always make a builder on top of flags for their own use.


> Make WordDelimiterFilter's instantiation more readable
> ------------------------------------------------------
>
>                 Key: LUCENE-3410
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3410
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: modules/analysis
>            Reporter: Chris Male
>            Priority: Minor
>
> Currently WordDelimiterFilter's constructor is:
> {code}
> public WordDelimiterFilter(TokenStream in,
> 	                             byte[] charTypeTable,
> 	                             int generateWordParts,
> 	                             int generateNumberParts,
> 	                             int catenateWords,
> 	                             int catenateNumbers,
> 	                             int catenateAll,
> 	                             int splitOnCaseChange,
> 	                             int preserveOriginal,
> 	                             int splitOnNumerics,
> 	                             int stemEnglishPossessive,
> 	                             CharArraySet protWords) {
> {code}
> which means its instantiation is an unreadable combination of 1s and 0s.  
> We should improve this by either using a Builder, 'int flags' or an EnumSet.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org