From 70917df47b91f7fbb16870b15f2a2ecdbdad6135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E9=97=AE=E4=B8=89=E4=B8=8D=E7=9F=A5?= <178428409@qq.com> Date: Thu, 20 Apr 2023 23:15:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Article.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Article.py b/app/Article.py index bfef595..9fc9c07 100644 --- a/app/Article.py +++ b/app/Article.py @@ -63,9 +63,7 @@ def get_today_article(user_word_list, had_read_articles): if amount_of_had_read_articles == amount_of_existing_articles: # 如果当前阅读过的文章的数量 == 存在的文章的数量,即所有的书本都阅读过了 result_of_generate_article = "had read all articles" else: - test_count = 0 for k in range(3): # 最多尝试3次 - test_count += 1 for reading in result: text_level = text_difficulty_level(reading['text'], d3) factor = random.gauss(0.8, 0.1) # a number drawn from Gaussian distribution with a mean of 0.8 and a stand deviation of 1 @@ -76,7 +74,6 @@ def get_today_article(user_word_list, had_read_articles): break if result_of_generate_article == "found": # 用于成功找到文章后及时退出外层循环 break - print(test_count) if result_of_generate_article != "found": # 阅读完所有文章,或者循环3次没有找到适合的文章,则对 index+=1 进行回滚 had_read_articles["index"] -= 1 else: # 生成已经阅读过的文章