r756@llin: dpavlin | 2006-07-01 12:17:24 +0200
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 1 Jul 2006 10:19:29 +0000 (10:19 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 1 Jul 2006 10:19:29 +0000 (10:19 +0000)
 pod improvements, added _debug

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@554 07558da8-63fa-0310-ba24-9fe276d99e06

lib/WebPAC/Normalize.pm

index 2ceb2b4..36f5e1e 100644 (file)
@@ -3,6 +3,7 @@ use Exporter 'import';
 @EXPORT = qw/
        _set_rec _set_lookup
        _get_ds _clean_ds
+       _debug
 
        tag search display
        marc marc_indicators marc_repeatable_subfield
@@ -29,11 +30,11 @@ WebPAC::Normalize - describe normalisaton rules using sets
 
 =head1 VERSION
 
-Version 0.06
+Version 0.07
 
 =cut
 
-our $VERSION = '0.06';
+our $VERSION = '0.07';
 
 =head1 SYNOPSIS
 
@@ -153,16 +154,32 @@ Get all fields defined by calls to C<marc>
 
        $marc->add_fields( WebPAC::Normalize:_get_marc_fields() );
 
-
-
 We are using I<magic> which detect repeatable fields only from
 sequence of field/subfield data generated by normalization.
 
-Repeatable field is created if there is second occurence of same subfield or
-if any of indicators are different. This is sane for most cases except for
-non-repeatable fields with repeatable subfields.
+Repeatable field is created when there is second occurence of same subfield or
+if any of indicators are different.
+
+This is sane for most cases. Something like:
+
+  900a-1 900b-1 900c-1
+  900a-2 900b-2
+  900a-3
+
+will be created from any combination of:
+
+  900a-1 900a-2 900a-3 900b-1 900b-2 900c-1
+
+and following rules:
+
+  marc('900','a', rec('200','a') );
+  marc('900','b', rec('200','b') );
+  marc('900','c', rec('200','c') );
 
-You can change behaviour of that using C<marc_repeatable_subfield>.
+which might not be what you have in mind. If you need repeatable subfield,
+define it using C<marc_repeatable_subfield> like this:
+
+....
 
 =cut
 
@@ -266,6 +283,20 @@ sub _get_marc_fields {
        return @m;
 }
 
+=head2 _debug
+
+Change level of debug warnings
+
+  _debug( 2 );
+
+=cut
+
+sub _debug {
+       my $l = shift;
+       return $debug unless defined($l);
+       $debug = $l;
+}
+
 =head1 Functions to create C<data_structure>
 
 Those functions generally have to first in your normalization file.