poj 3371 Flesch Reading Ease_不见不散的结局是曲终人散_新浪博客

本文介绍了一种评估英文段落阅读难度的方法——Flesch阅读易度,并提供了具体的计算公式及实现代码示例。该方法依据句子数、单词数和音节数来评判文本的可读性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Flesch Reading Ease
Time Limit: 1000MSMemory Limit: 65536K
Total Submissions: 2047Accepted: 600

Description

Flesch Reading Ease, a readability test named after its deviser Rudolf Flesch, is among most ubiquitously used readability tests, which are principally employed for assessment of the difficulty to understand a reading passage written in English. The Flesch Reading Ease score of a passage relies solely on three statistics, namely the total numbers of sentences, words and syllables, of the passage. Specifically, the score is defined by the following formula:

.

As can be inferred from the above formula, a passage with a high Flesch Reading Ease score tends to favor shorter sentences and words, which is in compliance with commonsense in spite of partial accuracy. (Think of, for instance, the word "television". Long as it may seem, it is indeed one of the first words that any individual who studies English learns.) A related Wikipedia entry on Flesch Reading Ease [1] suggests that passages scoring 90~100 are comprehensible for an average American 5th grader, and 8th and 9th graders possess the ability to follow passages with a score in the range of 60~70, whereas passages not exceeding 30 in the score are best suitable for college graduates. The text of this problem, all sections taken into account, scores roughly 50 as per the calculation of Google Documents.

Despite the simplicity in its ideas, several aspects of its definition remains vague for any real-world implementation of Flesch Reading Ease. For the sake of precision and uniformity, the following restrictions adapted from [2] are adopted for this problem, to which you are to write a solution that effectively computes the Flesch Reading Ease score of a given passage of English text.

  1. Periods, explanation points, colons and semicolons serve as sentence delimiters.
  2. Each group of continuous non-blank characters with beginning and ending punctuation removed counts as a word.
  3. Each vowel (one of a, e, i, o, u and y) in a word is considered one syllable subject to that
    1. -es, -ed and -e (except -le) endings are ignored,
    2. words of three letters or shorter count as single syllables,
    3. consecutive vowels count as one syllable.
References
  1. Wikipedia contributors. Flesch-Kincaid Readability Test. Wikipedia, The Free Encyclopedia. August 30, 2007, 01:57 UTC. Available at: http://en.wikipedia.org/w/index.php?title=Flesch-Kincaid_Readability_Test&oldid=154509512. Accessed September 5, 2007.
  2. Talburt, J. 1985. The Flesch index: An easily programmable readability analysis algorithm. In Proceedings of the 4th Annual international Conference on Systems Documentation. SIGDOC '85. ACM Press, New York, NY, 114-122.

Input

The input contains a passage in English whose Flesch Reading Ease score is to be computed. Only letters of the English alphabet (both lowercase and uppercase), common punctuation marks (periods, question and exclamation marks, colons, semicolons as well as commas, quotation marks, hyphens and apostrophes), and spaces appear in the passage. The passage is of indefinite length and possibly occupies multiple lines. Additionally, it is guaranteed to be correct in punctuation.  

Output

Output the Flesch Reading Ease score of the given passage rounded to two digits beyond decimal point.  

Sample Input

Flesch Reading Ease, a readability test named after its deviser Rudolf Flesch,
is among most ubiquitously used readability tests, which are principally
employed for assessment of the difficulty to understand a reading passage
written in English. The Flesch Reading Ease score of a passage relies solely
on three statistics, namely the total numbers of sentences, words and
syllables, of the passage.

Sample Output

26.09
题意:给出一段标准英语,统计里面的单词数,句子数,音节数,通过公式算出结果。

标准符号 ',' ' ' '.' ';' ':' '!' '?' 全是英语符号 逗号,空格,只分割单词。句号,分号,冒号,叹号,问号,分割句子和单词。

统计字节的时候:

1、单词长度小于等于3是,音节为1

2、大于3是,每个原音字母a,e,i,o,u,y,区分大小写,每个都是一个音节,如果结尾以-e(-le不算),-es,-ed结尾e不被记为一个音节,连续两个元音字母不能作为一个音节;然后进过上面的公式运算后输出结果;

代码如下:#include
#include
char yuan[12]= {'A','E','I','O','U','Y','a','e','i','o','u','y'};
char biaodian[5]= {'.','!',':',';','?'};
int yuanying(char a[],int len)
{
    int i,j;
    if(a[len-1]<'a'||a[len-1]>'z')//如果首位不为字母,怎暂时不进行运算;
        len--;
    int yi[20];
    memset(yi,0,sizeof(yi));
    int sum=0;
    if(len<=3)
        return 1;
    for(i=0; i
    {
        if(i==len-2)
        {
            if(a[len-2]=='e'&&a[len-1]=='s'||a[len-2]=='e'&&a[len-1]=='d')
             {
                    yi[i]=0;
                    continue;
             }
        }
            if(i==len-1&&a[i]=='e')
            {
                if(a[i-1]=='l')
                    yi[i]=1;
                else
                    yi[i]=0;
                continue;
         

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值