Librar...ber::LC(3pm)
π Library::CallNumber::LC β the perl manpage but make it cute β¨
okay bestie, so this is the Library::CallNumber::LC page from the User Contributed Perl Documentation section (section 3pm, if you're keeping score π). It's a Perl module for dealing with Library-of-Congress call numbers, and honestly? It ate. Let's get into it π
π NAME π
Library::CallNumber::LC β Deal with Library-of-Congress call numbers π¦
β¨ VERSION β¨
Version 0.23;
π SYNOPSIS π
Utility functions to deal with Library of Congress Call Numbers, no cap:
use Library::CallNumber::LC;
my $a = Library::CallNumber::LC->new('A 123.4 .c11');
print $a->normalize; # normalizes for string comparisons.
# gives 'A01234 C11'
print $a->start_of_range; # same as "normalize"
my $b = Library::CallNumber::LC->new('B11 .c13 .d11');
print $b->normalize;
# gives 'B0011 C13 D11'
my @range = ($a->start_of_range, $b->end_of_range);
# end of range is 'B0011 C13 D11~'
# Get components suitable for printing (e.g., number and decimal joined, leading dot on first cutter)
@comps = Library::CallNumber::LC->new('A 123.4 .c11')->components()
# Same thing, but return empty strings for missing components (e.g., the cutters)
@comps = Library::CallNumber::LC->new('A 123.4 .c11')->components('true');
π§ ABSTRACT π§
Library::CallNumber::LC is mostly designed to do call number normalization, with the following goals, and bestie these are the goals:
- The normalized call numbers are comparable with each other, for proper sorting π€
- The normalized call number is a short as possible, so left-anchored wildcard searches are possible (e.g., searching on
"A11*"should give you all the A11 call numbers) π - A range defined by
start_of_rangeandend_of_rangeshould be correct, assuming that the string given for the end of the range is, in fact, a left prefix π
That last point needs some explanation, fr fr. The idea is that if someone gives a range of, say, A-AZ, what they really mean is A - AZ9999.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 π (it's giving purely-functional, not giving realistic, and that's the point).
π CONSTRUCTORS π
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) π
π«Ά BASIC ACCESSORS π«Ά
call_number([call_number_text])
The text of the call number we are dealing with π
topper([character])
Specify which character occupies the 'always-sort-to-the-top' slots in the sort keys. Defaults to the SPACE character, but can reasonably be anything with an ASCII value lower than 48 (i.e. the 'zero' character, '0'). This can function as either a class or instance method depending on need π«
bottomer([character])
Specify which character occupies the 'always-sort-to-the-bottom' slots in the sort keys. Defaults to the TILDE character, but can reasonably be anything with an ASCII value higher than 90 (i.e. 'Z'). This can function as either a class or instance method depending on need π«
π₯ OTHER METHODS π₯
components(boolean returnAll = false)
@comps = Library::CallNumber::LC->new('A 123.4 .c11')->components($returnAll)
Returns an array of the individual components of the call number (or undef if it doesn't look like a call number π). Components are:
alphanumber(numeric.decimal)cutter1cutter2cutter3"extra"(anything after the cutters)
The optional argument returnAll (false by default) determines whether or not empty components (e.g., extra cutters) get a slot in the returned list π³οΈ
_normalize(call_number_text)
Base function to perform normalization π§Ό
normalize([call_number_text])
Normalize the stored or passed call number as a sortable string β¨
start_of_range([call_number_text])
Alias for normalize πͺ
end_of_range([call_number_text])
Downshift an lc number so it represents the end of a range β¬οΈ
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 $num_digits can be used to control the number of digits used, and therefore the precision of the results π―
π AUTHOR π
Current Maintainer: Dan Wells, "<dbw2 at calvin.edu>" Original Author: Bill Dueber, "<dueberb at umich.edu>" π
π 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 π¬ (yes bestie, you get notified about the notification, iconic behavior).
πΈ SUPPORT πΈ
You can find documentation for this module with the perldoc command.
perldoc Library::CallNumber::LC
You can also look for information at the Google Code page:
http://code.google.com/p/library-callnumber-lc/
π COPYRIGHT & LICENSE π
Copyright 2009 Bill Dueber, all rights reserved. Copyright 2011 Dan Wells, all rights reserved.
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 BSD license as described at http://www.opensource.org/licenses/bsd-license.php
okay that's the whole page, mwah π«Ά go normalize some call numbers, you've got this.
and that's a wrap on the perl v5.36.0 docs, dated 2022-10-22, straight from the Library::CallNumber::LC(3pm) corner of the User Contributed Perl Documentation π stay sortable, bestie β¨
π¦ where this page comes from
- ubuntu noble: liblibrary-callnumber-lc-perl 0.23-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later OR BSD-2-Clause
- ubuntu resolute: liblibrary-callnumber-lc-perl 0.23-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later OR BSD-2-Clause
- ubuntu stonking: liblibrary-callnumber-lc-perl 0.23-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later OR BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms