https://wiki.code4lib.org/index.php?title=245_indicator_2&feed=atom&action=history245 indicator 2 - Revision history2024-03-28T23:04:26ZRevision history for this page on the wikiMediaWiki 1.26.2https://wiki.code4lib.org/index.php?title=245_indicator_2&diff=7739&oldid=prevDoran: New page: This little (Perl) code snippet may be useful for parsing titles in data being converted to MARC record format. It determines the 245 indicator 2 value (Number of nonfiling characters). ...2011-03-31T23:59:56Z<p>New page: This little (Perl) code snippet may be useful for parsing titles in data being converted to MARC record format. It determines the 245 indicator 2 value (Number of nonfiling characters). ...</p>
<p><b>New page</b></p><div>This little (Perl) code snippet may be useful for parsing titles in data being converted to MARC record format. It determines the 245 indicator 2 value (Number of nonfiling characters). Although it is fairly trivial and only covers a few languages (and may be incomplete or have errors), it can be improved upon, corrected, and added to.<br />
<br />
# Search the title string for beginning articles. The 245 field<br />
# indicator 2 is the amount of spaces until the start of the<br />
# article-less title.<br />
#<br />
# English: A, An, The<br />
# German: Das, De, Dem, Den, Der, Des, Die,<br />
# Ein, Eine, Einem, Einer, Eines,<br />
# Keine, Keinen, Keiner<br />
# French: De l', De la, Des, Du,<br />
# L', La, Le, Les<br />
# Un Une<br />
# Spanish: El, La, Las, Los<br />
# Un, Una, Unas, Unos<br />
# Italian: Il<br />
# <br />
my $title_ind2 = "";<br />
if ($title =~ /^Keine[rn] /i) {<br />
$title_ind2 = "7";<br />
} elsif (<br />
$title =~ /^Eine[mrs] /i ||<br />
$title =~ /^Keine /i ||<br />
$title =~ /^De la /i) {<br />
$title_ind2 = "6";<br />
} elsif (<br />
$title =~ /^Eine /i ||<br />
$title =~ /^De l'/i ||<br />
$title =~ /^Un[ao]s /i) {<br />
$title_ind2 = "5";<br />
} elsif (<br />
$title =~ /^The /i ||<br />
$title =~ /^D[ae]s /i ||<br />
$title =~ /^Die /i ||<br />
$title =~ /^De[mnrs] /i ||<br />
$title =~ /^Ein /i ||<br />
$title =~ /^Un[ae] /i ||<br />
$title =~ /^L[aeo]s /i) {<br />
$title_ind2 = "4";<br />
$title_ind2 = "4";<br />
} elsif (<br />
$title =~ /^An /i ||<br />
$title =~ /^D[eu] /i ||<br />
$title =~ /^Un /i ||<br />
$title =~ /^L[ae] /i ||<br />
$title =~ /^El /i ||<br />
$title =~ /^Il /i) {<br />
$title_ind2 = "3";<br />
} elsif (<br />
$title =~ /^A /i ||<br />
$title =~ /^L'/i) {<br />
$title_ind2 = "2";<br />
} else {<br />
$title_ind2 = "0";<br />
}<br />
<br />
--[[User:Doran|Doran]] 16:59, 31 March 2011 (PDT)</div>Doran