.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Library::CallNumber::LC 3pm" .TH Library::CallNumber::LC 3pm "2012-05-26" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Library::CallNumber::LC \- Deal with Library\-of\-Congress call numbers .SH "VERSION" .IX Header "VERSION" Version 0.22; .SH "SYNOPSIS" .IX Header "SYNOPSIS" Utility functions to deal with Library of Congress Call Numbers .PP .Vb 10 \& use Library::CallNumber::LC; \& my $a = Library::CallNumber::LC\->new(\*(AqA 123.4 .c11\*(Aq); \& print $a\->normalize; # normalizes for string comparisons. \& # gives \*(AqA01234 C11\*(Aq \& print $a\->start_of_range; # same as "normalize" \& my $b = Library::CallNumber::LC\->new(\*(AqB11 .c13 .d11\*(Aq); \& print $b\->normalize; \& # gives \*(AqB0011 C13 D11\*(Aq \& my @range = ($a\->start_of_range, $b\->end_of_range); \& # end of range is \*(AqB0011 C13 D11~\*(Aq \& \& # Get components suitable for printing (e.g., number and decimal joined, leading dot on first cutter) \& @comps = Library::CallNumber::LC\->new(\*(AqA 123.4 .c11\*(Aq)\->components() \& \& # Same thing, but return empty strings for missing components (e.g., the cutters) \& @comps = Library::CallNumber::LC\->new(\*(AqA 123.4 .c11\*(Aq)\->components(\*(Aqtrue\*(Aq); .Ve .SH "ABSTRACT" .IX Header "ABSTRACT" Library::CallNumber::LC is mostly designed to do call number normalization, with the following goals: .IP "\(bu" 4 The normalized call numbers are comparable with each other, for proper sorting .IP "\(bu" 4 The normalized call number is a short as possible, so left-anchored wildcard searches are possible (e.g., searching on \*(L"A11*\*(R" should give you all the A11 call numbers) .IP "\(bu" 4 A range defined by start_of_range and end_of_range should be correct, assuming that the string given for the end of the range is, in fact, a left prefix. .PP That last point needs some explanation. The idea is that if someone gives a range of, say, A\-AZ, what they really mean is A \- \s-1AZ9999\s0.99. The end_of_range method generates a key which lies immediately beyond the last possible key for a given starting point. There is no attempt to make end_of_range normalization correspond to anything in real life. .SH "CONSTRUCTORS" .IX Header "CONSTRUCTORS" .ie n .SS "new([call_number_text, [topper_character, [bottomer_character]]]) \*(-- create a new object, optionally passing in the initial string, a ""topper"", and a ""bottomer"" (explained below)" .el .SS "new([call_number_text, [topper_character, [bottomer_character]]]) \*(-- create a new object, optionally passing in the initial string, a ``topper'', and a ``bottomer'' (explained below)" .IX Subsection "new([call_number_text, [topper_character, [bottomer_character]]]) create a new object, optionally passing in the initial string, a topper, and a bottomer (explained below)" .SH "BASIC ACCESSORS" .IX Header "BASIC ACCESSORS" .SS "call_number([call_number_text])" .IX Subsection "call_number([call_number_text])" The text of the call number we are dealing with. .SS "topper([character])" .IX Subsection "topper([character])" Specify which character occupies the 'always\-sort\-to\-the\-top' slots in the sort keys. Defaults to the \s-1SPACE\s0 character, but can reasonably be anything with an \s-1ASCII\s0 value lower than 48 (i.e. the 'zero' character, '0'). This can function as either a class or instance method depending on need. .SS "bottomer([character])" .IX Subsection "bottomer([character])" Specify which character occupies the 'always\-sort\-to\-the\-bottom' slots in the sort keys. Defaults to the \s-1TILDE\s0 character, but can reasonably be anything with an \s-1ASCII\s0 value higher than 90 (i.e. 'Z'). This can function as either a class or instance method depending on need. .SH "OTHER METHODS" .IX Header "OTHER METHODS" .SS "components(boolean returnAll = false)" .IX Subsection "components(boolean returnAll = false)" .Vb 1 \& @comps = Library::CallNumber::LC\->new(\*(AqA 123.4 .c11\*(Aq)\->components($returnAll) .Ve .PP Returns an array of the individual components of the call number (or undef if it doesn't look like a call number). Components are: .IP "\(bu" 4 alpha .IP "\(bu" 4 number (numeric.decimal) .IP "\(bu" 4 cutter1 .IP "\(bu" 4 cutter2 .IP "\(bu" 4 cutter3 .IP "\(bu" 4 \&\*(L"extra\*(R" (anything after the cutters) .PP The optional argument (false by default) determines whether or not empty components (e.g., extra cutters) get a slot in the returned list. .SS "_normalize(call_number_text)" .IX Subsection "_normalize(call_number_text)" Base function to perform normalization. .SS "normalize([call_number_text])" .IX Subsection "normalize([call_number_text])" Normalize the stored or passed call number as a sortable string .SS "start_of_range([call_number_text])" .IX Subsection "start_of_range([call_number_text])" Alias for normalize .SS "end_of_range([call_number_text])" .IX Subsection "end_of_range([call_number_text])" Downshift an lc number so it represents the end of a range .SS "toLongInt(call_number_text, num_digits)" .IX Subsection "toLongInt(call_number_text, num_digits)" Attempt to turn a call number into an integer value. Possibly useful for fast range checks, although obviously not perfectly accurate. Optional argument \fI\f(CI$num_digits\fI\fR can be used to control the number of digits used, and therefore the precision of the results. .SH "AUTHOR" .IX Header "AUTHOR" Current Maintainer: Dan Wells, \f(CW\*(C`\*(C'\fR Original Author: Bill Dueber, \f(CW\*(C`\*(C'\fR .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests through the web interface at http://code.google.com/p/library\-callnumber\-lc/issues/list . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc Library::CallNumber::LC .Ve .PP You can also look for information at the Google Code page: .PP .Vb 1 \& http://code.google.com/p/library\-callnumber\-lc/ .Ve .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2009 Bill Dueber, all rights reserved. Copyright 2011 Dan Wells, all rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself and also under the new \s-1BSD\s0 license as described at http://www.opensource.org/licenses/bsd\-license.php