You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Chris Fournier (JIRA)" <ji...@apache.org> on 2012/10/31 15:29:12 UTC

[jira] [Created] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

Chris Fournier created OPENNLP-544:
--------------------------------------

             Summary: Added an interface for opennlp.tools.util.Span
                 Key: OPENNLP-544
                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
             Project: OpenNLP
          Issue Type: Improvement
          Components: Tokenizer
    Affects Versions: tools-1.5.3
            Reporter: Chris Fournier
            Priority: Trivial
             Fix For: tools-1.5.3


Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Updated] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier updated OPENNLP-544:
-----------------------------------

    Attachment: Spannable_OPENNLP-544-1.5.3.patch

Patch created using 'git diff --no-prefix'
                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Commented] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

Posted by "Aliaksandr Autayeu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENNLP-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493036#comment-13493036 ] 

Aliaksandr Autayeu commented on OPENNLP-544:
--------------------------------------------

Jörn's question reminded me that we might need to refactor the rest of the toolkit to use Spannable instead of Span (btw, that's the reason I wasn't hurrying to accept the patch). Jörn, what do you think?
                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Comment Edited] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier edited comment on OPENNLP-544 at 11/8/12 6:19 PM:
-----------------------------------------------------------------

I went ahead and made the SpannableApplied patch, which includes both the Spannable pacth and also refactors the rest of opennlp-tool to utilize Spannable:

- opennlp.tools.coref.mention.Mention and opennlp.tools.parser.Constituent now extend Span, but also still contain Spannable object internally in some cases (opennlp.tools.parser.Parse also contains Spannable objects, but is not a Spannable object);
- Method signatures accept and return Spannable;
- Generics utilize Spannable; and
- Arrays are of Spannable objects.

All 278 of opennlp-tools's unit tests pass using this patch (which also refactors the tests to use the Spannable interface).

This improvement it not necessarily needed, but, it could prove useful and third parties (e.g., myself!) would appreciate the interface.  It is also probably a bad idea to add it and then not use it in opennlp itself (if it was to be accepted).
                
      was (Author: cfournie):
    I went ahead and made the SpannableApplied patch, which includes both the Spannable path and also refactors the rest of opennlp-tool to utilize Spannable:

- opennlp.tools.coref.mention.Mention and opennlp.tools.parser.Constituent now extend Span, but also still contain Spannable object internally in some cases (opennlp.tools.parser.Parse also contains Spannable objects, but is not a Spannable object);
- Method signatures accept and return Spannable;
- Generics utilize Spannable; and
- Arrays are of Spannable objects.

All 278 of opennlp-tools's unit tests pass using this patch (which also refactors the tests to use the Spannable interface).

This improvement it not necessarily needed, but, it could prove useful and third parties (e.g., myself!) would appreciate the interface.  It is also probably a bad idea to add it and then not use it in opennlp itself (if it was to be accepted).
                  
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: SpannableApplied_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Comment Edited] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier edited comment on OPENNLP-544 at 11/8/12 6:19 PM:
-----------------------------------------------------------------

I went ahead and made the SpannableApplied patch, which includes both the Spannable path and also refactors the rest of opennlp-tool to utilize Spannable:

- opennlp.tools.coref.mention.Mention and opennlp.tools.parser.Constituent now extend Span, but also still contain Spannable object internally in some cases (opennlp.tools.parser.Parse also contains Spannable objects, but is not a Spannable object);
- Method signatures accept and return Spannable;
- Generics utilize Spannable; and
- Arrays are of Spannable objects.

All 278 of opennlp-tools's unit tests pass using this patch (which also refactors the tests to use the Spannable interface).

This improvement it not necessarily needed, but, it could prove useful and third parties (e.g., myself!) would appreciate the interface.  It is also probably a bad idea to add it and then not use it in opennlp itself (if it was to be accepted).
                
      was (Author: cfournie):
    I went ahead and made the SpannableApplied patch, which include both the Spannable path and also refactors the rest of opennlp-tool to utilize Spannable:

- opennlp.tools.coref.mention.Mention and opennlp.tools.parser.Constituent now extend Span, but also still contain Spannable object internally in some cases (opennlp.tools.parser.Parse also contains Spannable objects, but is not a Spannable object);
- Method signatures accept and return Spannable;
- Generics utilize Spannable; and
- Arrays are of Spannable objects.

All 278 of opennlp-tools's unit tests pass using this patch (which also refactors the tests to use the Spannable interface).

This improvement it not necessarily needed, but, it could prove useful and third parties (e.g., myself!) would appreciate the interface.  It is also probably a bad idea to add it and then not use it in opennlp itself (if it was to be accepted).
                  
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: SpannableApplied_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Commented] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

Posted by "Joern Kottmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENNLP-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492830#comment-13492830 ] 

Joern Kottmann commented on OPENNLP-544:
----------------------------------------

Do you have a use case where you would like to pass in your own spans?
                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Updated] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier updated OPENNLP-544:
-----------------------------------

    Attachment: Spannable_OPENNLP-544-1.5.3.patch
    
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: Spannable_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Commented] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier commented on OPENNLP-544:
----------------------------------------

I think that you are correct on all three points. Thanks! To that end, I've added a new patch that now:

1) Removes dependencies in types/signatures to the implementation;
2) Moves many comments to the interface and leaves Javadoc references to the interface in the implementation;
3) Removes compareTo from the interface definition, and instead has the interface extend Comparable;
4) Adds the ASF 2.0 license to the header.

Any further improvements?

                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: Spannable_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Commented] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier commented on OPENNLP-544:
----------------------------------------

I went ahead and made the SpannableApplied patch, which include both the Spannable path and also refactors the rest of opennlp-tool to utilize Spannable:

- opennlp.tools.coref.mention.Mention and opennlp.tools.parser.Constituent now extend Span, but also still contain Spannable object internally in some cases (opennlp.tools.parser.Parse also contains Spannable objects, but is not a Spannable object);
- Method signatures accept and return Spannable;
- Generics utilize Spannable; and
- Arrays are of Spannable objects.

All 278 of opennlp-tools's unit tests pass using this patch (which also refactors the tests to use the Spannable interface).

This improvement it not necessarily needed, but, it could prove useful and third parties (e.g., myself!) would appreciate the interface.  It is also probably a bad idea to add it and then not use it in opennlp itself (if it was to be accepted).
                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: SpannableApplied_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Updated] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier updated OPENNLP-544:
-----------------------------------

    Attachment:     (was: Spannable_OPENNLP-544-1.5.3.patch)
    
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Commented] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier commented on OPENNLP-544:
----------------------------------------

My use case for the patch is for a 3rd party app that uses the Span class sometimes inside other objects that extend something else (giving the appearance of multiple inheritance), or simply to add a Span-like contract (i.e., Spannable) to objects which have a beginning and end position.

In opennlp, many things could extend Span instead of contain one, e.g., opennlp.tools.coref.mention.Mention, opennlp.tools.parser.Constituent, opennlp.tools.parser.Parse, but there may be objects which could extend something else yet can still act like a Span.  After a quick look I couldn't find any, unfortunately.
                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Updated] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier updated OPENNLP-544:
-----------------------------------

    Fix Version/s:     (was: tools-1.5.3)
                   1.6.0
    
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: 1.6.0
>
>         Attachments: SpannableApplied_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Commented] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

Posted by "Joern Kottmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENNLP-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494643#comment-13494643 ] 

Joern Kottmann commented on OPENNLP-544:
----------------------------------------

We should do the same for all the String references, these are usually much more expensive to convert, e.g. you have a StringBuilder, but the API only accepts a String, if it would accept a CharSequence the StringBuilder could be passed in directly.
                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: SpannableApplied_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Commented] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

Posted by "Joern Kottmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENNLP-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493464#comment-13493464 ] 

Joern Kottmann commented on OPENNLP-544:
----------------------------------------

In the 1.5.x series of releases we cannot break backward compatibility. All existing user code which works with 1.5.0 must also work with 1.5.2 or 1.5.3. This patch is breaking backward compatibility in some places.

I personally do not see the advantage in the current code to have these other objects implementing the Spannable interface, it gives the user the illusion that it might be ok to pass in an array of Parse token objects and the text to a TokenNameFinder, but it is not because the offsets in the Parse object have a different semantics as they are used in the TokenNameFidner (char offsets vs. token offsets).

Anyway, having a Spannable without further refactoring in the OpenNLP code base does not make much sense to me. I suggest that we do this later e.g. for 1.6 when we have some freedom to change our API as well and be able to fix things like the Parse object.

What do you think?
                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: SpannableApplied_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Commented] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

Posted by "Aliaksandr Autayeu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENNLP-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494641#comment-13494641 ] 

Aliaksandr Autayeu commented on OPENNLP-544:
--------------------------------------------

Jörn, good points, I agree. You have a broader view, thank you! I didn't think about backward compatibility. I'd add there fixing span semantics and moving to interfaces to the 1.6 feature list. Often interfaces allow one to save memory (or at least alloc\free) by combining objects.
                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: SpannableApplied_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Comment Edited] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier edited comment on OPENNLP-544 at 11/8/12 6:20 PM:
-----------------------------------------------------------------

I went ahead and made the SpannableApplied patch, which includes both the Spannable pacth and also refactors the rest of opennlp-tool to utilize Spannable:

- opennlp.tools.coref.mention.Mention and opennlp.tools.parser.Constituent now extend Span, but also still contain Spannable object internally in some cases (opennlp.tools.parser.Parse also contains Spannable objects, but does not extend a Span object);
- Method signatures accept and return Spannable;
- Generics utilize Spannable; and
- Arrays are of Spannable objects.

All 278 of opennlp-tools's unit tests pass using this patch (which also refactors the tests to use the Spannable interface).

This improvement it not necessarily needed, but, it could prove useful and third parties (e.g., myself!) would appreciate the interface.  It is also probably a bad idea to add it and then not use it in opennlp itself (if it was to be accepted).
                
      was (Author: cfournie):
    I went ahead and made the SpannableApplied patch, which includes both the Spannable pacth and also refactors the rest of opennlp-tool to utilize Spannable:

- opennlp.tools.coref.mention.Mention and opennlp.tools.parser.Constituent now extend Span, but also still contain Spannable object internally in some cases (opennlp.tools.parser.Parse also contains Spannable objects, but is not a Spannable object);
- Method signatures accept and return Spannable;
- Generics utilize Spannable; and
- Arrays are of Spannable objects.

All 278 of opennlp-tools's unit tests pass using this patch (which also refactors the tests to use the Spannable interface).

This improvement it not necessarily needed, but, it could prove useful and third parties (e.g., myself!) would appreciate the interface.  It is also probably a bad idea to add it and then not use it in opennlp itself (if it was to be accepted).
                  
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: SpannableApplied_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Updated] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

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

Chris Fournier updated OPENNLP-544:
-----------------------------------

    Attachment: SpannableApplied_OPENNLP-544-1.5.3.patch
    
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: SpannableApplied_OPENNLP-544-1.5.3.patch, Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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

[jira] [Commented] (OPENNLP-544) Added an interface for opennlp.tools.util.Span

Posted by "Aliaksandr Autayeu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENNLP-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13488877#comment-13488877 ] 

Aliaksandr Autayeu commented on OPENNLP-544:
--------------------------------------------

Chris, thank you for the patch. It looks interesting and I gave it a look. I'd say a couple of things, would you mind commenting?

1) I'd say it's not nice if interface depends on implementation:
+	/**
+	 * @see Span#compareTo
+	 */
+	int compareTo(Span s);

2) I'd say that Javadocs should move from implementation to interface.

3) I'd say that int compareTo(Span s) is really from Comparable and a better solution might be to inherit, rather than copy. May be like this: public interface Spannable extends Comparable<Spannable> { ...

What do you think?
                
> Added an interface for opennlp.tools.util.Span
> ----------------------------------------------
>
>                 Key: OPENNLP-544
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-544
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Tokenizer
>    Affects Versions: tools-1.5.3
>            Reporter: Chris Fournier
>            Priority: Trivial
>              Labels: newbie, patch
>             Fix For: tools-1.5.3
>
>         Attachments: Spannable_OPENNLP-544-1.5.3.patch
>
>
> Added an interface, opennlp.tools.util.Spannable, to allow for the creation of objects that can span text and fulfill the same functionality as Span without necessarily needing to extend it (currently implemented only by opennlp.tools.util.Span).

--
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