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

Biblio::Citation::Compare - Perl extension for performing fuzzy comparisons between bibliographic

Author

       David Bourget, http://www.dbourget.com

Description

       This module exports two subroutines which perform fuzzy comparisons between citations (described using
       Perl hashes) and author lists. The subroutine attempt to determine if the citations and author lists
       refer to the same works and ordered lists of authors, respectively.

Name

       Biblio::Citation::Compare - Perl extension for performing fuzzy comparisons between bibliographic
       citations

See Also

       See also Text::Names for name normalization.

Subroutines

sameWork(hashrefcitation1,hashrefcitation2):boolean
       Takes as input two citations in a simple format illustrated in the synopsis. Returns true iff the two
       citations plausibly refer to the same work. A number of factors are taken into account to make the
       evaluation resistant to random variations. Among them: names are normalized and compared fuzzily using
       Text::Names, allowances are made for random typos, allowances are made for short and long versions of
       titles (esp with titles containing a colon), small but important variations as in "Paper title part 1"
       and "Paper title part 2" are taken into account. The algorithm has been used to merge multiple data
       sources on PhilPapers.org.

       Some advanced additional parameters are not explained here; they can only be explained by pointing to the
       source code. Their use should not normally be necessary.

   sameAuthors(arrayreflist1,arrayreflist2):boolean
       Returns true if the two lists are plausibly lists of the same authors. This is merely a convenient
       wrapper over Text::Names::samePerson.

   EXPORT
       None by default.

Synopsis

         use Biblio::Citation::Compare 'sameWork','sameAuthors';

         sameWork(
           # first item
           {
               authors => ['Bourget, D','Lukasiak, Zbigniew'],
               title => "A paper with such and such a title",
               date => 2010
           },
           # second item
           {
               authors => ['Bourget, David J. R.','Lukasiak, Zbigniew'],
               title => "A paper with such nd such a tlitle",
               date => undef
           }
         );

         # true!

         sameAuthors(
           ['Dave Bourget','Z Lukasiak'],
           ['Bourget DJR','Zbigniew Z. Lukasiak']
         );

         # true!

See Also