WikiExtractor.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:WikiExtractor_To_the_one_text 作者: j-min 项目源码 文件源码
def makeInternalLink(title, label):
    colon = title.find(':')
    if colon > 0 and title[:colon] not in acceptedNamespaces:
        return ''
    if colon == 0:
        # drop also :File:
        colon2 = title.find(':', colon + 1)
        if colon2 > 1 and title[colon + 1:colon2] not in acceptedNamespaces:
            return ''
    if Extractor.keepLinks:
        return '<a href="%s">%s</a>' % (quote(title.encode('utf-8')), label)
    else:
        return label


# ----------------------------------------------------------------------
# External links

# from: https://doc.wikimedia.org/mediawiki-core/master/php/DefaultSettings_8php_source.html
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号