logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Text::BibTeX::Validate - validator for BibTeX format

Authors

       Andrius Merkys, <merkys@cpan.org>

perl v5.32.1                                       2021-02-28                        Text::BibTeX::Validate(3pm)

Description

       Text::BibTeX::Validate checks the standard fields of BibTeX entries for their compliance with their
       format. In particular, value of "email" is checked against RFC 822 mandated email address syntax, value
       of "doi" is checked to start with 10. and contain at least one "/" and so on.  Some nonstandard fields as
       "isbn", "issn" and "url" are also checked.  Failures of checks are returned as instances of
       Text::BibTeX::Validate::Warning.

Methods

validate_BibTeX($what)
       Takes plain Perl hash reference containing BibTeX fields and their values, as well as Text::BibTeX::Entry
       instances and returns an array of validation messages as instances of Text::BibTeX::Validate::Warning.

   clean_BibTeX($what)
       Takes the same input as "validate_BibTeX" and attempts to reconcile trivial issues like dropping the
       resolver URL part of DOIs (see "shorten_DOI" method) and converting month numbers into three-letter
       abbreviations.

   shorten_DOI($doi)
       Remove the resolver URL part, as well as "doi:" prefixes, from DOIs.

Name

       Text::BibTeX::Validate - validator for BibTeX format

Synopsis

           use Text::BibTeX;
           use Text::BibTeX::Validate qw( validate_BibTeX );

           my $bibfile = Text::BibTeX::File->new( 'bibliography.bib' );
           while( my $entry = Text::BibTeX::Entry->new( $bibfile ) ) {
               for my $warning (validate_BibTeX( $entry )) {
                   print STDERR "$warning\n";
               }
           }

See Also