修复分母为 0 的问题,增加适当的异常处理
使用正则表达式处理标点符号 改进变量命名,提高代码可读性 定义常量替代魔术数字 添加输入验证和错误处理 移除冗余代码 优化性能pull/208/head
							parent
							
								
									26455031a6
								
							
						
					
					
						commit
						4839c45414
					
				|  | @ -150,3 +150,4 @@ if __name__ == '__main__': | ||||||
|     article_estimator = ArticleVocabularyLevel(article_content) |     article_estimator = ArticleVocabularyLevel(article_content) | ||||||
|     article_level = article_estimator.level |     article_level = article_estimator.level | ||||||
|     print(f"文章难度等级:{article_level:.2f}") |     print(f"文章难度等级:{article_level:.2f}") | ||||||
|  | # 从错误分支(feature/temp-vocab)获取 vocabulary.py 的修改 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue