On Wed, Aug 27, 2003 at 09:15:25AM -0300, Brian Cassidy wrote:
> * normalize()
> 
> inputs: either a MARC::Record object or a string. This should probably
> accept an arbitrary number of inputs so, you can do
> 
> my @normrecs = normalize( @records );
> 
> rather than
> 
> my @normrecs;
> foreach my $rec ( @records ) {
>       push @normrecs, normalize( $rec );
> }
> 
> But you still could if you wanted to.
> 
> Given a M::R object it would do as the rules state [1] for the
> appropriate fields in the record. Returns a M::R object.
> 
> Given a string, it would apply the string normalization rules. Returns a
> string.
> 
> * compare()
> 
> inputs: either two M::R objects or two strings.
> 
> Given two M::R objects, both are normalize()'ed. It would return false
> (or should it be true?) if, based on the rules [1], some field in $a
> matches some field in $b.
> 
> Given two strings, both are again normalize()'ed and a simple "cmp" is
> performed.

I like the idea of a package MARC::Record::NACO which exports the normalize() 
and compare() functions. My $.02 are that you not overload normalize() and 
compare() too much, but create different functions, since you'll have the 
entire MARC::Record::NACO namespace to play with! 

normalize( $string );
normalize_record( $record, 100, 110, etc );
compare( $string );
compare_record( $record1, $record2, 100, 110, etc );

I know its heresy, but when it comes to designing programs and interfaces I've 
come to trust an aspect of the Unix philosophy over the Perl philosophy. 

Unix: Make each program (function) do one thing well.
Perl: DWIM (Do What I Mean)

I see you've got CPAN modules up there already, but if you need any help with 
the test suite or anything I would be willing to help out. At any rate, please 
post to the list if you end up releasing something.

//Ed

Reply via email to