Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 2.11 KB

File metadata and controls

42 lines (27 loc) · 2.11 KB

Wikipedia Duplicated Citations Merger

Test

The free encyclopedia already stated that:

"If you simply copy exactly the same reference and citation, the citation will become duplicated."

Unfortunately, it's common to spot duplicated citations in the wild, for example within the page David Green and 國旗. The best way to resolve this issue is by using named references, which is exactly how this tool works!

For example, it would transfrom the following Wikitext:

These are two<ref>{{cite book|title=LibreOffice for Starters|edition=First|publisher=Flexible Minds|location=Manchester|year=2002|p=18}}</ref>
citations<ref>{{cite book|title=LibreOffice for Starters|edition=First|publisher=Flexible Minds|location=Manchester|year=2002|p=18}}</ref>.

to

These are two<ref name="LibreOff56c">{{cite book|title=LibreOffice for Starters|edition=First|publisher=Flexible Minds|location=Manchester|year=2002|p=18}}</ref>
citations<ref name="LibreOff56c" />.

which not only reduces some text, but also prevents the reference list from bloating.

Usage

screenshot

Requires Python 3.8 or later.

Limitations

  • Can only do exact match on <ref> tags, i.e. it's not smart enough to merge two references having a high similarity.
    • However, it's quite easy to provide such feature by extending the CitationDatabase class.