# -*- coding: utf-8 -*- # Crates HTML reports for easily finding double-links. # The input files are created by getlanglinks.py # Written by Denny Vrandečić and released 23 June 2012, http://denny.vrandecic.de # Released under the BSD license import os count = 0 for txts in os.listdir('doublelinks') : if txts[-4:] == '.txt' : lang = txts[12:-4] f = open('doublelinks/' + txts, 'r') result = open('doublelinks/doublelinks.' + lang + '.html', 'w') result.write(""" Double language links on """ + lang + """ Wikipedia

Double language links on """ + lang + """ Wikipedia

The Wikipedia articles linked to here listed, as of the dump created on June 23rd, 2012, more than one language link to the same other language. This may indicate an error.


"""); for line in f : line = line.strip() title, link = line.split(' ') result.write('

' + title + ' to [[' + link + ']]

' + "\n") result.write("""

Created June 23rd 2012, Denny Vrandečić.

Back to overview page

"""); result.close() f.close() print count