修复分母为 0 的问题,增加适当的异常处理

使用正则表达式处理标点符号
改进变量命名,提高代码可读性
定义常量替代魔术数字
添加输入验证和错误处理
移除冗余代码
优化性能
pull/208/head
Desuver 2025-06-04 23:02:52 +08:00
parent 26455031a6
commit 4839c45414
1 changed files with 1 additions and 0 deletions

View File

@ -150,3 +150,4 @@ if __name__ == '__main__':
article_estimator = ArticleVocabularyLevel(article_content)
article_level = article_estimator.level
print(f"文章难度等级:{article_level:.2f}")
# 从错误分支feature/temp-vocab获取 vocabulary.py 的修改