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

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

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


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

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13094653#comment-13094653 ] 

Uwe Schindler commented on LUCENE-3410:
---------------------------------------

OK, if those integers are always used only as boolean flags, I would prefer a single (int flags) parameter. No builder pattern needed. I would maybe prefer a long to make it extensibler (but 31 flags should be enough, too).

> 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


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

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13094642#comment-13094642 ] 

Yonik Seeley commented on LUCENE-3410:
--------------------------------------

For historical context, the reason I used an int for stuff like generateWordParts was that I had the idea of using it as a minimum (i.e. only generate word parts that are over a certain size, etc).  This obviously never happened though ;-)

> 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


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

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098972#comment-13098972 ] 

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

any objections to backporting? we could then remove the deprecation in trunk.

> 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
>            Assignee: Chris Male
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-3410.patch, LUCENE-3410.patch, LUCENE-3410.patch
>
>
> 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


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

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Male updated LUCENE-3410:
-------------------------------

    Attachment: LUCENE-3410.patch

Patch with the Iterator back to using booleans.  Going to commit.

> 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
>         Attachments: LUCENE-3410.patch, LUCENE-3410.patch
>
>
> 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


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

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098980#comment-13098980 ] 

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

I can take it if you want Chris, unless you want to do the honors?

> 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
>            Assignee: Chris Male
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-3410.patch, LUCENE-3410.patch, LUCENE-3410.patch
>
>
> 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


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

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3410:
--------------------------------

    Fix Version/s: 3.5

backported to 3.5

> 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
>            Assignee: Chris Male
>            Priority: Minor
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3410.patch, LUCENE-3410.patch, LUCENE-3410.patch
>
>
> 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


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

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098053#comment-13098053 ] 

Chris Male commented on LUCENE-3410:
------------------------------------

{quote}
should the iterator maybe keep the booleans and not use flags? just an idea, because the iterator doesn't "make use" of all the flags. its also not a public class and just a helper class to simplify the filter, so i think its ok for it to take 3 booleans?
{quote}

Yeah I thought about this as well.  It would make the iterator clearer since it wouldn't rely on people looking at the Filter's flags.  I will make the change.

> 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
>         Attachments: LUCENE-3410.patch
>
>
> 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


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

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098046#comment-13098046 ] 

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

looks good overall, a couple tiny nitpicks:

* looks like there is some dead code in WordDelimiterIterator (the booleans)
* should the iterator maybe keep the booleans and not use flags? just an idea, because the iterator doesn't "make use" of all the flags. its also not a public class and just a helper class to simplify the filter, so i think its ok for it to take 3 booleans?

> 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
>         Attachments: LUCENE-3410.patch
>
>
> 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


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

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098982#comment-13098982 ] 

Chris Male commented on LUCENE-3410:
------------------------------------

Go for it!

> 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
>            Assignee: Chris Male
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-3410.patch, LUCENE-3410.patch, LUCENE-3410.patch
>
>
> 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


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

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Male updated LUCENE-3410:
-------------------------------

    Attachment: LUCENE-3410.patch

Patch for WDF & co, converting them over to int flags.

Old behavior is deprecated but we could do that in 3x and nuke in trunk.

> 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
>         Attachments: LUCENE-3410.patch
>
>
> 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


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

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098976#comment-13098976 ] 

Chris Male commented on LUCENE-3410:
------------------------------------

None whatsoever.

> 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
>            Assignee: Chris Male
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-3410.patch, LUCENE-3410.patch, LUCENE-3410.patch
>
>
> 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


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

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Male updated LUCENE-3410:
-------------------------------

    Attachment: LUCENE-3410.patch

Better patch.

> 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
>         Attachments: LUCENE-3410.patch, LUCENE-3410.patch, LUCENE-3410.patch
>
>
> 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


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

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ 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


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

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098041#comment-13098041 ] 

Uwe Schindler commented on LUCENE-3410:
---------------------------------------

+1

> 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
>         Attachments: LUCENE-3410.patch
>
>
> 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


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

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Male resolved LUCENE-3410.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0
         Assignee: Chris Male

Committed revision 1165995.

> 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
>            Assignee: Chris Male
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-3410.patch, LUCENE-3410.patch, LUCENE-3410.patch
>
>
> 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


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

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098036#comment-13098036 ] 

Chris Male commented on LUCENE-3410:
------------------------------------

Plan to commit soon if theres no objections.

> 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
>         Attachments: LUCENE-3410.patch
>
>
> 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