From: Robert Dober Date: 2007-04-10T16:52:03+09:00 Subject: Re: How to Write a Spelling Corrector On 4/10/07, Joel VanderWerf wrote: > Brian Adkins wrote: > > 3) Minor point, but apparently Python has a built in constant for the set > > of lower case characters "string.lowercase", so I just defined a constant. > ... > > LETTERS = 'abcdefghijklmnopqrstuvwxyz' > > A minor comment: you can construct this string with > > ("a".."z").to_a.join > => "abcdefghijklmnopqrstuvwxyz" Almost nobody, not even the gurus ever use [*a..b] instead of (a..b).to_a. The performance is about the same, the former seems faster for short arrays/ranges ~ 500 and from about 1k elements the later gets slightly faster. I feel that [*a..b] is the right/better/more logical construct to use if one wants an array, or do I miss something? Cheers Robert > > -- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 > > -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw