Biblio...Compare(3pm)

πŸ’– Biblio::Citation::Compare β€” the perl manual, but make it bestie πŸ’–

User Contributed Perl Documentation ✨ Biblio...Compare(3pm)

ok so. bestie. you know how you've got like five different citation databases and they all spell "Bourget, David J. R." differently and you're just supposed to know it's the same guy?? yeah. this module is the girl who knows. πŸ’…


✨ NAME ✨

Biblio::Citation::Compare β€” a Perl extension for doing fuzzy comparisons between bibliographic citations πŸ¦‹


✨ SYNOPSIS ✨

like, just use it, okay:

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!

# true! 😭 it literally said yes to both. no cap. 🫢


✨ DESCRIPTION ✨

okay so this module exports two subroutines. Two! That's it. They do fuzzy comparisons between citations β€” and citations here are described using Perl hashes β€” and between author lists. The subroutines attempt to figure out whether the citations, and the ordered lists of authors, actually refer to the same works and the same ordered lists of authors respectively. πŸŽ€


✨ SUBROUTINES ✨

🌸 sameWork(hashref citation1, hashref citation2): boolean

Takes two citations as input, in the simple format shown up in the synopsis. Returns true iff the two citations plausibly refer to the same work. ✨

A whole bunch of factors get taken into account so the evaluation stays resistant to random variations. Among them:

  • names are normalized and compared fuzzily using Text::Names 🧚
  • allowances are made for random typos πŸ’€ (we've all been there)
  • allowances are made for short and long versions of titles (esp with titles containing a colon) πŸ‘‘
  • small but important variations β€” like "Paper title part 1" vs "Paper title part 2" β€” are taken into account πŸ™ˆ
The algorithm has been used to merge multiple data sources on PhilPapers.org. πŸ”₯ iconic behaviour honestly.

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. ✨ (iykyk)

🌸 sameAuthors(arrayref list1, arrayref list2): boolean

Returns true if the two lists are plausibly lists of the same authors. πŸ’–

This is merely a convenient wrapper over Text::Names::samePerson. that's it. that's the whole function. she's a little delegate. we respect her. πŸ’…


✨ EXPORT ✨

None by default. πŸ™ˆ (you have to ask, bestie, that's what the use line is for)


✨ SEE ALSO ✨

See also Text::Names for name normalization. πŸ¦‹


✨ AUTHOR ✨

David Bourget, http://www.dbourget.com πŸ‘‘


Copyright (C) 2011 by David Bourget

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.


πŸŽ€ ok that's the whole page bestie, go compare some citations, you're gonna slay πŸŽ€

perl v5.36.0 Β· 2023-02-14 β€” yeah this was last touched on valentine's day, which is highkey the most romantic thing a manpage has ever done πŸ’– mwah, bye 🫢✨

πŸ“¦ where this page comes from