From 0c16a4dc6f21849915cdad92c7189e37ccb9a289 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: Wed, 29 Mar 2023 20:53:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=96=87=E7=AB=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=B7=B2=E7=BB=8F=E5=87=BA=E7=8E=B0=E7=9A=84=E8=AF=AD?= =?UTF-8?q?=E5=8F=A5=E5=86=99=E9=94=99=E4=BD=8D=E7=BD=AE=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E6=AD=A3=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Article.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Article.py b/app/Article.py index 707ad91..d67995b 100644 --- a/app/Article.py +++ b/app/Article.py @@ -59,7 +59,8 @@ def get_today_article(user_word_list, existing_articles): 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 - if within_range(reading['article_id'] not in existing_articles[1] and text_level, user_level, (8.0 - user_level) * factor): # 新的文章之前没有出现过且符合一定范围的水平 + print("factor:{}, text_level:{}, user_level:{}, range:{}".format(factor, text_level, user_level, (8.0 - user_level) * factor)) + if reading['article_id'] not in existing_articles[1] and within_range(text_level, user_level, (8.0 - user_level) * factor): # 新的文章之前没有出现过且符合一定范围的水平 d = reading existing_articles[1].append(d['article_id']) # 列表添加新的文章id;下面进行 flag = True