On Fri, Nov 22, 2013 at 03:07:48AM +0100, Philippe Bruhat (BooK) wrote: > > Mmm, maybe a better word than "score" or "summary" is "category". > > So what about something along the lines of Data::Categorize? > (although Data:: is a prefix that usually adds no information) >
And using the word "categorize" to look for modules yielded List::Categorize, which has the following in its SYNOPSIS: my %odds_and_evens = categorize { $_ % 2 ? 'ODD' : 'EVEN' } (1..9); # %odds_and_evens now contains # ( ODD => [ 1, 3, 5, 7, 9 ], EVEN => [ 2, 4, 6, 8 ] ) The code references returned by my module could be used as the first parameter of categorize, if the list to be categorized contained hash references. The main characteristic of my module is that the generated routines are processing already categorized data (the hashes contain a count of the number of elements in each category). Now that I think about it, it's probably trivial to add support for hashes such as those returned by List::Categorize's categorize function (basically, add an extra line of code to the generated subroutine, like "ref eq ARRAY && $_ = @$_ for values %count"). Adding the notion of rank to the mix is probably very easy too. As for naming the module (assuming we can call the return value of List::Categorize's categorize function a "category"), what about Category::Categorize? -- Philippe Bruhat (BooK) Ignorance weaves a web from which none can escape. (Moral from Groo The Wanderer #52 (Epic))