Re: [Text, Lang] Matching two CharSequence instances

2019-03-02 Thread Alex Herbert
> On 3 Mar 2019, at 02:00, Bruno P. Kinoshita wrote: > > Hi Alex, > Also found the two implementations similar, but confusing. > - The parameter name inconsistency > +1 > > > - The edge case logic inconsistency > > +1 > > - Change to a stepwise charAt comparison > +1 if the behaviour is ke

Re: [Text, Lang] Matching two CharSequence instances

2019-03-02 Thread Bruno P. Kinoshita
Hi Alex, Also found the two implementations similar, but confusing. - The parameter name inconsistency +1 - The edge case logic inconsistency +1 - Change to a stepwise charAt comparison +1 if the behaviour is kept. Right now some crazy characters like those old latin letters are supported (e.

Re: [Text, Lang] Matching two CharSequence instances

2019-03-02 Thread Alex Herbert
Having looked a bit more at StringUtils it appears that: public static boolean equals(final CharSequence cs1, final CharSequence cs2); public static boolean equalsIgnoreCase(final CharSequence str1, final CharSequence str2); share edge case logic checking but it is implemented differently (altho

Re: [Text, Lang] Matching two CharSequence instances

2019-03-02 Thread Alex Herbert
> On 2 Mar 2019, at 16:59, Mark Dacek wrote: > > Is your proposed method a stepwise charAt comparison across both, assuming > non-null and equal length? Yes. Although the StringUtils.equals(CharSequence, CharSequence) from [lang] will do the job correctly (thanks Gary). It currently does all t

Re: [Text, Lang] Matching two CharSequence instances

2019-03-02 Thread Mark Dacek
Is your proposed method a stepwise charAt comparison across both, assuming non-null and equal length? Doesn't seem like a bad idea, though I'm curious whether there's a use-case where toString() on both and comparing isn't more expedient. On Sat, Mar 2, 2019 at 11:53 AM Alex Herbert wrote: > I a

Re: [Text, Lang] Matching two CharSequence instances

2019-03-02 Thread Gary Gregory
See org.apache.commons.lang3.StringUtils.equals(CharSequence, CharSequence) Gary On Sat, Mar 2, 2019 at 11:53 AM Alex Herbert wrote: > I am helping with the PR for TEXT-126 to add to the similarity package. > > Part of the new algorithm requires identifying if two CharSequences are > identical.

[Text, Lang] Matching two CharSequence instances

2019-03-02 Thread Alex Herbert
I am helping with the PR for TEXT-126 to add to the similarity package. Part of the new algorithm requires identifying if two CharSequences are identical. Is there a utility in Text to do something like this: public static boolean CharSequenceUtils.equals(CharSequence, CharSequence); I cannot f