# Creates a html page with the distribution of title lengths in the Wikipedias # Written by Denny Vrandecic and released 10 May 2012, http://denny.vrandecic.de # Released under the BSD license import urllib, gzip percentile1 = 90 percentile2 = 98 langs = ['kr', 'mus', 'ho', 'kj', 'aa', 'mh', 'cho', 'ii', 'ng', 'ki', 'xh', 'tw', 'ff', 'st', 'ny', 'chy', 'ch', 'lg', 'tum', 'fj', 'ak', 'dz', 'cr', 'rn', 'sg', 'ts', 've', 'om', 'bxr', 'ks', 'ti', 'zu', 'ha', 'ee', 'cdo', 'got', 'pnt', 'chr', 'za', 'pih', 'iu', 'ss', 'ik', 'bm', 'bi', 'sd', 'mo', 'sm', 'tn', 'kbd', 'cu', 'rmy', 'nso', 'ltg', 'kaa', 'mwl', 'kg', 'tet', 'na', 'ig', 'ab', 'lo', 'srn', 'sn', 'ty', 'dsb', 'kab', 'av', 'mdf', 'as', 'jbo', 'wo', 'tpi', 'lbe', 'bjn', 'gag', 'pap', 'kl', 'arc', 'zea', 'myv', 'gn', 'ce', 'crh', 'eml', 'ace', 'to', 'krc', 'ay', 'pfl', 'pdc', 'frr', 'ln', 'rw', 'xmf', 'haw', 'xal', 'pcd', 'ie', 'or', 'ext', 'szl', 'stq', 'frp', 'kw', 'nv', 'hak', 'so', 'cbk-zam', 'ksh', 'zh-classical', 'nov', 'sc', 'bh', 'lad', 'ang', 'kv', 'mhr', 'pi', 'koi', 'lij', 'ug', 'mt', 'wuu', 'csb', 'fur', 'udm', 'km', 'ps', 'mzn', 'rm', 'pa', 'pag', 'rue', 'nrm', 'dv', 'gv', 'se', 'vls', 'tk', 'ky', 'ilo', 'nds-nl', 'fiu-vro', 'mrj', 'bo', 'bar', 'ckb', 'bcl', 'fo', 'glk', 'gan', 'si', 'co', 'ba', 'li', 'mi', 'hsb', 'mn', 'sa', 'hif', 'pam', 'uz', 'sco', 'sah', 'nah', 'arz', 'os', 'gd', 'roa-tara', 'yi', 'vec', 'tg', 'zh-min-nan', 'my', 'bug', 'map-bms', 'als', 'kn', 'am', 'wa', 'ia', 'bat-smg', 'cv', 'nap', 'ga', 'tt', 'ast', 'diq', 'su', 'qu', 'zh-yue', 'ku', 'ur', 'scn', 'nds', 'ne', 'hy', 'af', 'pnb', 'gu', 'ml', 'io', 'bn', 'sw', 'fy', 'lmo', 'bpy', 'an', 'yo', 'bs', 'is', 'mr', 'mg', 'lb', 'cy', 'be', 'jv', 'lv', 'sq', 'br', 'be-x-old', 'ceb', 'ta', 'te', 'pms', 'sh', 'ht', 'ka', 'mk', 'tl', 'oc', 'roa-rup', 'la', 'el', 'new', 'th', 'nn', 'simple', 'gl', 'az', 'et', 'hi', 'hr', 'war', 'vo', 'eu', 'kk', 'bg', 'he', 'ms', 'sk', 'sl', 'lt', 'sr', 'eo', 'da', 'ar', 'fa', 'ro', 'tr', 'id', 'ko', 'hu', 'cs', 'vi', 'fi', 'no', 'uk', 'ca', 'zh', 'sv', 'pt', 'ja', 'ru', 'es', 'pl', 'it', 'nl', 'fr', 'de', 'en']; #langs = ['simple' ,'hr', 'sr', 'ja']; # for testing result = open('index.html', 'w'); result.write(""" Length of titles in Wikipedia

Distribution of title lengths in Wikipedias

*

"""); for lang in reversed(langs) : result.write('

' + lang + "

\n"); result.write('
' + "\n"); result.write(""" """); result.close(); print "Done."