From: Rick DeNatale Date: 2007-12-27T23:46:29+09:00 Subject: Re: Sorting Titles in Ruby On Dec 27, 2007 4:34 AM, Martin DeMello wrote: > On Dec 24, 2007 9:11 PM, Rick DeNatale wrote: > > Before I start writing this, I thought I'd see if something already > > exists, but I'm having trouble formulating a good google search this > > morning. > > You can use my titlecase utility as a starting point: > > http://zem.novylen.net/ruby/titlecase.rb > > martin I think that capitalizing a title "properly," whatever that means, is a separate issue. In fact I had just done some google searching on phrases like "title capitalization" and it seems that there are all kinds of different styles. I also see that ActiveSupport has a titlecase method on String which just capitalizes each word. So for my application, I think I'll leave the title capitalization to the humans, and I'm leaning towards sorting a canonical form which moves leading articles to the end of the title, and converts numbers (I'm just now thinking about Roman numerals) to words, then lowercases everything to make the sort case insensitive. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/