You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/07/24 04:05:01 UTC

[jira] [Commented] (TEXT-98) Remove isDelimiter() and use HashSets for delimiter check

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

ASF GitHub Bot commented on TEXT-98:
------------------------------------

GitHub user arunvinudss opened a pull request:

    https://github.com/apache/commons-text/pull/57

    TEXT-98: Remove isDelimiter and use HashSets for delimiter checks

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/arunvinudss/commons-text TEXT-98

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-text/pull/57.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #57
    
----
commit eabb18efa39b1fbebf66d46282d6abc3f9b2c7aa
Author: Arun Vinud <ar...@capitalone.com>
Date:   2017-07-23T14:57:37Z

    Remove isDelimiter and using HashSets for delimiter checks

----


> Remove isDelimiter() and use HashSets for delimiter check
> ---------------------------------------------------------
>
>                 Key: TEXT-98
>                 URL: https://issues.apache.org/jira/browse/TEXT-98
>             Project: Commons Text
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Arun Vinud 
>            Priority: Minor
>             Fix For: 1.2
>
>
> The current implementation of *capitalize*, *uncapitalize* and *initials* in *WordUtils* calls isDelimiter for every character and/or codepoint and isDelimiter loops through the array of delimiters to check for the  occurrence. This is a bit inefficient and results in O(nk) complexity and it can be reduced to O(n)[if n>k] or O(k)[if k>n].



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)