Re: [csv] CSVRecord implements Map

2014-01-15 Thread Benedikt Ritter
2014/1/16 Gary Gregory > Maybe we _should_ revisit splitting the record class. Now, we have the > following slots: > > CSVRecord: > comment : String > mapping : Map > recordNumber : long > values : String[] > > If we take out mapping and put in it a subclass, that reduces the "size" of > the plai

Re: [csv] CSVRecord implements Map

2014-01-15 Thread Gary Gregory
Maybe we _should_ revisit splitting the record class. Now, we have the following slots: CSVRecord: comment : String mapping : Map recordNumber : long values : String[] If we take out mapping and put in it a subclass, that reduces the "size" of the plain record by 25%: CSVRecord: comment : String

Re: [LANG] New class called StringAlgorithms?

2014-01-15 Thread Oliver Heger
Am 15.01.2014 15:05, schrieb Benedikt Ritter: > 2014/1/15 Gary Gregory > >> On Wed, Jan 15, 2014 at 8:06 AM, Benedikt Ritter >> wrote: >> >>> Hi Gary, >>> >>> 2014/1/15 Gary Gregory >>> On Wed, Jan 15, 2014 at 7:00 AM, Benedikt Ritter wrote: > Hi all, > > we curre

Re: [LANG] Handling of empty string in StringUtils

2014-01-15 Thread Benedikt Ritter
2014/1/13 Paul Benedict > Splitting with an empty string doesn't make any sense to me. Nothing should > match that -- even an empty string. It's a lack of a token. > Okay, and that's the reason why currently StringUtils.split("", ".") = [ ] but StringUtils.split("x", ".") = ["x"] I guess I und

Re: [LANG] New class called StringAlgorithms?

2014-01-15 Thread Gary Gregory
On Wed, Jan 15, 2014 at 12:27 PM, Benedikt Ritter wrote: > 2014/1/15 dbrosius > > > Invariably people will want a method signature that takes an algorithm > > enum as a parameter so it need not be statically selected > > > > I'm not sure I agree here. The more parameters a method has the less eas

Re: [LANG] New class called StringAlgorithms?

2014-01-15 Thread Benedikt Ritter
2014/1/15 dbrosius > Invariably people will want a method signature that takes an algorithm > enum as a parameter so it need not be statically selected > I'm not sure I agree here. The more parameters a method has the less easy it is to understand. I don't really see a use case were an applicati

Re: [csv] CSVRecord implements Map

2014-01-15 Thread Emmanuel Bourg
Le 15/01/2014 07:17, Benedikt Ritter a écrit : > A wrapper of some kind like Adrian suggested sounds like the way to go > here. Maybe we could have something like: > > Map map = CSVRecordUtils.toMap(record); I had something like that in mind too, but I would rather use record.toMap() and avoid ex

RE: [LANG] New class called StringAlgorithms?

2014-01-15 Thread dbrosius
Invariably people will want a method signature that takes an algorithm enum as a parameter so it need not be statically selected Original message From: Benedikt Ritter Date:01/15/2014 7:00 AM (GMT-05:00) To: Commons Developers List Subject: [LANG] New class called StringA

Re: [LANG] New class called StringAlgorithms?

2014-01-15 Thread Benedikt Ritter
2014/1/15 Gary Gregory > On Wed, Jan 15, 2014 at 8:06 AM, Benedikt Ritter > wrote: > > > Hi Gary, > > > > 2014/1/15 Gary Gregory > > > > > On Wed, Jan 15, 2014 at 7:00 AM, Benedikt Ritter > > > wrote: > > > > > > > Hi all, > > > > > > > > we currently have StringUtils.getLevenshteinDistance.

Re: [LANG] New class called StringAlgorithms?

2014-01-15 Thread Gary Gregory
On Wed, Jan 15, 2014 at 8:06 AM, Benedikt Ritter wrote: > Hi Gary, > > 2014/1/15 Gary Gregory > > > On Wed, Jan 15, 2014 at 7:00 AM, Benedikt Ritter > > wrote: > > > > > Hi all, > > > > > > we currently have StringUtils.getLevenshteinDistance. LANG-944 [1] is > > about > > > introducing a new s

Re: [LANG] Handling of empty string in StringUtils

2014-01-15 Thread Benedikt Ritter
2014/1/15 Gary Gregory > On Wed, Jan 15, 2014 at 1:19 AM, Benedikt Ritter > wrote: > > > I'd like to change the behavior then, if nobody objects. I'll write some > > prose for the release notes of 3.3 (which I plan to roll out early > > February) > > > > Cool. > > Do you plan on reviewing all of

Re: [LANG] New class called StringAlgorithms?

2014-01-15 Thread Benedikt Ritter
Hi Gary, 2014/1/15 Gary Gregory > On Wed, Jan 15, 2014 at 7:00 AM, Benedikt Ritter > wrote: > > > Hi all, > > > > we currently have StringUtils.getLevenshteinDistance. LANG-944 [1] is > about > > introducing a new string algorithm called Jaro Winkler Distance [2]. > Since > > StringUtils alread

Re: [LANG] Handling of empty string in StringUtils

2014-01-15 Thread Gary Gregory
On Wed, Jan 15, 2014 at 1:19 AM, Benedikt Ritter wrote: > I'd like to change the behavior then, if nobody objects. I'll write some > prose for the release notes of 3.3 (which I plan to roll out early > February) > Cool. Do you plan on reviewing all of [lang], StringUtils, or the subset of Strin

Re: [csv] CSVRecord implements Map

2014-01-15 Thread Gary Gregory
On Wed, Jan 15, 2014 at 4:19 AM, Jörg Schaible wrote: > Hi Adrian, > > Adrian Crum wrote: > > > That would only work if the CSV file had column names. > > No, it works only if it has *unique* column names. Guess, this is normally > the case, but there's no such requirement. > If your column name

Re: [csv] CSVRecord implements Map

2014-01-15 Thread Gary Gregory
On Wed, Jan 15, 2014 at 1:17 AM, Benedikt Ritter wrote: > A wrapper of some kind like Adrian suggested sounds like the way to go > here. Maybe we could have something like: > > Map map = CSVRecordUtils.toMap(record); > Uh, I want to go the other way around. See my use case. Gary > > Benedikt >

Re: [LANG] New class called StringAlgorithms?

2014-01-15 Thread Gary Gregory
On Wed, Jan 15, 2014 at 7:00 AM, Benedikt Ritter wrote: > Hi all, > > we currently have StringUtils.getLevenshteinDistance. LANG-944 [1] is about > introducing a new string algorithm called Jaro Winkler Distance [2]. Since > StringUtils already does a lot of things, I'm wondering if it may make >

[LANG] New class called StringAlgorithms?

2014-01-15 Thread Benedikt Ritter
Hi all, we currently have StringUtils.getLevenshteinDistance. LANG-944 [1] is about introducing a new string algorithm called Jaro Winkler Distance [2]. Since StringUtils already does a lot of things, I'm wondering if it may make sense to introduce a new class that serves as a host for more string

Re: [csv] CSVRecord implements Map

2014-01-15 Thread Jörg Schaible
Hi Adrian, Adrian Crum wrote: > That would only work if the CSV file had column names. No, it works only if it has *unique* column names. Guess, this is normally the case, but there's no such requirement. > Maybe make a > class that implements Map and contains a CSVRecord - so it's optional.