• 大小: 52.62MB
    文件类型: .zip
    金币: 2
    下载: 2 次
    发布日期: 2023-01-26
  • 语言: Python
  • 标签:

资源简介

最全中华古诗词数据库, 唐宋两朝近一万四千古诗人, 接近5.5万首唐诗加26万宋诗. 两宋时期1564位词人,21050首词。

资源截图

代码片段和文件信息

#! -*- coding: utf-8 -*-
“““

   测试古诗JSON文件是否有效

“““

import os json

def check_json(f):
    filepath = os.path.join(‘./json‘ f)
    with open(filepath) as file:
        try:
            _ = json.loads(file.read())
            return True
        except:
            assert False “校验(%s)失败“ % f


def test_json():
    map(check_json os.listdir(‘./json‘))

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\
     文件          95  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\.travis.yml
     文件        4012  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\README.md
     目录           0  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\ci\
     文件         574  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\ci\README.md
     文件     5779456  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\ci\ci.db
     目录           0  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\
     文件       26002  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\WechatIMG1.jpeg
     文件      200735  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\ci_author_topK.png
     文件     1521043  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\ci_rhythmic_topK.png
     文件      180750  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\ci_words_topK.png
     文件      495776  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\full-tang-poetry.png
     文件      253331  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\song_author_topK.png
     文件      221835  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\song_text_topK.png
     文件      247971  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\tang_author_topK.png
     文件      241416  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\images\tang_text_topK.png
     目录           0  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\
     文件     3084922  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\authors.song.json
     文件      672847  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\authors.tang.json
     文件      533535  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.0.json
     文件      496150  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.1000.json
     文件      610051  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.10000.json
     文件      617841  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.100000.json
     文件      612167  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.101000.json
     文件      568337  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.102000.json
     文件      528829  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.103000.json
     文件      602579  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.104000.json
     文件      708665  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.105000.json
     文件      440301  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.106000.json
     文件      576187  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.107000.json
     文件      661948  2017-05-26 02:54  chinese-poetry-chinese-poetry-6248485\json\poet.song.108000.json
............此处省略303个文件信息

评论

共有 条评论