可读性评分
使用Flesch-Kincaid等公式分析文本可读性。
SMOG 等级需要至少 30 个句子。
关于此工具
可读性分数工具使用Flesch-Kincaid等级水平和Flesch阅读轻松指数等既定的可读性指标来分析文本的易理解程度。这些公式通过测量句子长度、词汇复杂度和音节数等因素,为您的写作清晰度提供可操作的见解。对于希望确保信息有效传达给目标受众的作家、教育工作者和内容创作者来说,理解文本的可读性至关重要。
只需将文本粘贴到该工具中,它就会立即计算多个可读性分数。Flesch阅读轻松指数的范围是0-100,分数越高表示阅读越容易,而Flesch-Kincaid等级水平则显示理解文本所需的美国学年水平。该工具显示详细的指标,包括单词数、句子数、平均句子长度和音节分析。这对于创建博客文章、学术论文、营销文案和需要达到特定受众理解水平的教育材料特别有用。
需要注意的是,可读性公式最适用于英文文本,对于技术术语、专有名词或专业词汇可能不那么准确。这些分数只是指南而非绝对规则——语境、词汇选择和格式同样在整体清晰度中起重要作用。无论您是在修改学生论文、为更广泛的受众优化网络内容,还是确保专业沟通的易读性,这个工具都能为您提高写作质量提供量化反馈。
常见问题
代码实现
import re
import math
def count_syllables(word: str) -> int:
word = word.lower().strip(".,!?;:")
if len(word) <= 3:
return 1
word = re.sub(r'e$', '', word)
vowels = re.findall(r'[aeiouy]+', word)
return max(1, len(vowels))
def readability_scores(text: str) -> dict:
sentences = len(re.findall(r'[.!?]+', text)) or 1
words_list = re.findall(r'\b\w+\b', text)
words = len(words_list) or 1
syllables = sum(count_syllables(w) for w in words_list)
complex_words = sum(1 for w in words_list if count_syllables(w) >= 3)
flesch_ease = 206.835 - 1.015 * (words / sentences) - 84.6 * (syllables / words)
fk_grade = 0.39 * (words / sentences) + 11.8 * (syllables / words) - 15.59
gunning_fog = 0.4 * ((words / sentences) + 100 * (complex_words / words))
return {
"flesch_reading_ease": round(flesch_ease, 1),
"flesch_kincaid_grade": round(fk_grade, 1),
"gunning_fog_index": round(gunning_fog, 1),
"word_count": words,
"sentence_count": sentences,
"syllable_count": syllables,
}
sample = "The quick brown fox jumps over the lazy dog. It was a beautiful day in the park."
print(readability_scores(sample))Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.