view release on metacpan or search on metacpan
lib/Biblio/bp/lib/bp-bibtex.pl view on Meta::CPAN
} elsif ( $rec{'TYPE'} =~ /^mastersthesis/i ) {
$rec{'type'} = 'Masters';
}
}
if (defined $rec{'author'} ) {
# check for braces around the whole name, in which case we will
# assume it is a corporate author.
if ( ($rec{'author'} =~ /^\{/) && ($rec{'author'} =~ /\}$/) ) {
$can{'CorpAuthor'} = substr($rec{'author'}, $[+1, length($rec{'author'})-2);
} else {
$can{'Authors'} = &bibtex_name_to_canon( $rec{'author'} );
}
delete $rec{'author'};
}
if (defined $rec{'editor'}) {
$can{'Editors'} = &bibtex_name_to_canon( $rec{'editor'} );
# XXXXX either we don't need this, or we need it for authors also.
delete $can{'Editors'} unless $can{'Editors'} =~ /\S/;
lib/Biblio/bp/lib/bp-bibtexo.pl view on Meta::CPAN
} elsif ( $rec{'TYPE'} =~ /^mastersthesis/i ) {
$rec{'type'} = 'Masters';
}
}
if (defined $rec{'author'} ) {
# check for braces around the whole name, in which case we will
# assume it is a corporate author.
if ( ($rec{'author'} =~ /^\{/) && ($rec{'author'} =~ /\}$/) ) {
$can{'CorpAuthor'} = substr($rec{'author'}, $[+1, length($rec{'author'})-2);
} else {
$can{'Authors'} = &bibtex_name_to_canon( $rec{'author'} );
}
delete $rec{'author'};
}
if (defined $rec{'editor'}) {
$can{'Editors'} = &bibtex_name_to_canon( $rec{'editor'} );
# XXXXX either we don't need this, or we need it for authors also.
delete $can{'Editors'} unless $can{'Editors'} =~ /\S/;
lib/Biblio/bp/lib/bp-cstra.pl view on Meta::CPAN
sub implode {
local(%entry) = @_;
$ent = '';
local(@keys) = sort { index($opt_order,$a) <=> index($opt_order,$b) }
keys(%entry);
local($unknown_ent) = '';
# unknown fields are at the top
foreach $field (@keys) {
last if index($opt_order,$field) >= $[;
&bib'gotwarn("CSTRA implode: unknown field identifier: $field");
$unknown_ent .= "\%$field $entry{$field}\n" if length($field) == 1;
shift @keys;
}
foreach $field (@keys) {
$entry{$field} =~ s/$bib'cs_sep/\n\%$field /go;
$ent .= "\%$field $entry{$field}\n";
}
$ent .= $unknown_ent;
lib/Biblio/bp/lib/bp-endnote.pl view on Meta::CPAN
sub implode {
local(%entry) = @_;
$ent = '';
local(@keys) = sort { index($opt_order,$a) <=> index($opt_order,$b) }
keys(%entry);
local($unknown_ent) = '';
# unknown fields are at the top
foreach $field (@keys) {
last if index($opt_order,$field) >= $[;
&bib'gotwarn("refer implode: unknown field identifier: $field");
$unknown_ent .= "\%$field $entry{$field}\n" if length($field) == 1;
shift @keys;
}
foreach $field (@keys) {
$entry{$field} =~ s/$bib'cs_sep/\n\%$field /go;
$ent .= "\%$field $entry{$field}\n";
}
$ent .= $unknown_ent;
lib/Biblio/bp/lib/bp-p-cs.pl view on Meta::CPAN
return $_ unless /${bib'cs_meta}01[01]/;
local(@fontstack) = ();
local($fontsmatch, $font, $pfont);
# Check for this special occurance: They don't have end fonts (or don't
# use them). They just make everything a begin font (troff often does this).
# Solution: Try to fix it up by replacing each begin after the first with
# an endprevious / begin pair. Then remove the last begin.
if (!/${bib'cs_meta}011/) {
local($pos) = $[;
local($lpos) = 0;
local($distance) = length($bib'cs_meta) + 3;
local($n) = 0;
while (($pos = index($_, "${bib'cs_meta}010", $pos)) >= $[) {
$n++;
if ($n == 1) {
$lpos = $pos;
$pfont = substr($_, $pos + $distance, 1);
$pos++;
next;
}
$lpos = $pos;
$font = substr($_, $pos + $distance, 1);
substr($_, $pos, 0) = "${bib'cs_meta}0110";
lib/Biblio/bp/lib/bp-p-debug.pl view on Meta::CPAN
#
# We should use:
#
# &panic("function called with no arguments") unless defined $foo;
#
# instead, if that's what you're doing. First, it's quite a bit faster,
# and second, because panic can be changed to give a usage message.
#
sub assert {
&panic("Assertion failed: $_[$[]",$@) unless eval $_[$[];
}
sub panic {
select(STDERR);
print "\nBP ERROR: @_\n";
if ($] >= 5.000) {
local($i,$_);
local($p,$f,$l,$s,$h,$w,$a,@a,@sub);
for ($i = 1; ($p,$f,$l,$s,$h,$w) = caller($i); $i++) {
lib/Biblio/bp/lib/bp-p-debug.pl view on Meta::CPAN
}
}
}
local($width) = 16 - &log2($level);
printf STDERR "BPD: (%14s) %s%s\n", $s, ' ' x $width, $statement;
}
sub log2 {
log($_[$[]) / log(2);
}
#
# Consistency checker.
#
# This is called in various spots throughout the package, usually before and
# after opening and closing a file, and when changing formats. This will
# probably go with the production version, but just called fewer times. It's
# not that long right now, and it doesn't get called often.
lib/Biblio/bp/lib/bp-p-utils.pl view on Meta::CPAN
#print STDERR "$key -> ";
if ($keytype eq 'author') {
# # turn "Stephen van Rensselaer, Jr." into "vanRensselaerJr".
# #$key =~ s/^([^\/]*)\/([^\/]*)\/([^\/]*)\/([^\|]*).*/$2$1$4/;
# # turn "Stephen van Rensselaer, Jr." into "Rensselaer"
# #$key =~ s/^([^\/]*)\/.*/$1/;
# Remove everything past the first seperator
local($split_sep) = index($key, $bib'cs_sep2);
substr($key, $split_sep) = '' if $split_sep >= $[;
} elsif ($keytype eq 'org') {
$key =~ s/^(\S*).*/$1/;
} else {
# text
}
#print STDERR "$key -> ";
$key = &bib'nocharset($key);
#print STDERR "$key -> ";
$key =~ tr/A-Za-z0-9\/\-//cd;
lib/Biblio/bp/lib/bp-refer.pl view on Meta::CPAN
}
}
#substr($ent, -1, 1) = '';
} else {
local(@keys) = sort { index($opt_order,$a) <=> index($opt_order,$b) }
keys(%entry);
local($unknown_ent) = '';
# unknown fields are at the top
foreach $field (@keys) {
last if index($opt_order,$field) >= $[;
&bib'gotwarn("refer implode: unknown field identifier: $field");
$unknown_ent .= "\%$field $entry{$field}\n" if length($field) == 1;
shift @keys;
}
foreach $field (@keys) {
$entry{$field} =~ s/$bib'cs_sep/\n\%$field /go;
$ent .= "\%$field $entry{$field}\n";
}
$ent .= $unknown_ent;
}
lib/Biblio/bp/lib/bp-tib.pl view on Meta::CPAN
sub implode {
local(%entry) = @_;
local($ent) = '';
# tib's implode method 0.
local(@keys) = sort { index($opt_order,$a) <=> index($opt_order,$b) }
keys(%entry);
local($unknown_ent) = '';
# unknown fields are at the top
foreach $field (@keys) {
last if index($opt_order,$field) >= $[;
&bib'gotwarn("tib implode: unknown field identifier: $field");
$unknown_ent .= "\%$field $entry{$field}\n" if length($field) == 1;
shift @keys;
}
# XXXXXX Shouldn't unknown_ent's be checked for seperators also?
foreach $field (@keys) {
$entry{$field} =~ s/$bib'cs_sep/\n\%$field /g;
$ent .= "\%$field $entry{$field}\n";
}
$ent .= $unknown_ent;