22814_AbstractExtrac

2022-5-16 18:23| 发布者: Hocassian| 查看: 20| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506982406400-Problem List-采集的数据-后羿采集器.html

Pro.ID

22814

Title

Abstract Extract

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22814

AC

1

Submit

1

Ratio

100.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    When writing articles, there is usually an abstract section which summarizes the entire article. We are experimenting with an automatic abstract generation algorithm. The algorithm reads in an article and prepares an abstract that summarizes the entire article. The abstract is formed by combining the "topic sentences" extracted from consecutive paragraphs.

    For the purposes of this problem,

    • An article consists of one or more paragraphs.

    • A paragraph is a maximal sequence of non-empty lines.

    • A sentence is a maximal sequence of characters within a paragraph that begins with a nonwhitespace character, that ends with a '.' (period), '?', or '!', and that does not contain any other occurrences of '.', '?', or '!'.

    • A word is a maximal sequence of alphabetic characters within a sentence.

    The term maximal in the definitions above is intended to convey the idea that we are only interested in the longest sequences that match the definition, not in any of their subsequences. For example, the sentence "How now, brown cow?" contains four words. "now" is a word in this sentence, but "no", "ow", etc., are not words because they are not maximal -- they are subsequences of a larger sequence of alphabetic characters.

    A topic sentence for a paragraph is the single sentence in the paragraph that best describes the paragraph's content. For our purposes, we will select the earliest sentence in the paragraph that maximizes the number of distinct words in S that also occur in any following sentence within the same paragraph.

    Paragraphs with fewer than three sentences are ignored and will not contribute to the abstract.

    When comparing words for distinctness, changes in upper/lower case are ignored. For example, the sentence "See what I see." contains three distinct words, not four.

    输入

    Input will consist of one or more articles. Each article is terminated by a line containing only "***" or "******". The latter string ("******") indicates the end of the entire input set.

    • Each article will contain one or more paragraphs. Each paragraph will consist of one or more non-empty lines, and is terminated by an empty line or by the "***" or "******" markers described above.

    • No article will be longer than 500 lines; No line will contain more than 150 characters. No word will contain more than 50 characters.

    • The only whitespace characters in the input will be blanks (ASCII 32) and line terminators.

    输出

    Description

    When writing articles, there is usually an abstract section which summarizes the entire article. We are experimenting with an automatic abstract generation algorithm. The algorithm reads in an article and prepares an abstract that summarizes the entire article. The abstract is formed by combining the "topic sentences" extracted from consecutive paragraphs.

    For the purposes of this problem,

    • An article consists of one or more paragraphs.

    • A paragraph is a maximal sequence of non-empty lines.

    • A sentence is a maximal sequence of characters within a paragraph that begins with a nonwhitespace character, that ends with a '.' (period), '?', or '!', and that does not contain any other occurrences of '.', '?', or '!'.

    • A word is a maximal sequence of alphabetic characters within a sentence.

    The term maximal in the definitions above is intended to convey the idea that we are only interested in the longest sequences that match the definition, not in any of their subsequences. For example, the sentence "How now, brown cow?" contains four words. "now" is a word in this sentence, but "no", "ow", etc., are not words because they are not maximal -- they are subsequences of a larger sequence of alphabetic characters.

    A topic sentence for a paragraph is the single sentence in the paragraph that best describes the paragraph's content. For our purposes, we will select the earliest sentence in the paragraph that maximizes the number of distinct words in S that also occur in any following sentence within the same paragraph.

    Paragraphs with fewer than three sentences are ignored and will not contribute to the abstract.

    When comparing words for distinctness, changes in upper/lower case are ignored. For example, the sentence "See what I see." contains three distinct words, not four.

    Input

    Input will consist of one or more articles. Each article is terminated by a line containing only "***" or "******". The latter string ("******") indicates the end of the entire input set.

    • Each article will contain one or more paragraphs. Each paragraph will consist of one or more non-empty lines, and is terminated by an empty line or by the "***" or "******" markers described above.

    • No article will be longer than 500 lines; No line will contain more than 150 characters. No word will contain more than 50 characters.

    • The only whitespace characters in the input will be blanks (ASCII 32) and line terminators.

    Output

    For each document, print the abstract followed by a line containing "======" (six equal signs).

    Each abstract will be formed from the sequence of topic sentences, selected as described above, in the order that they occur in the input document. Each sentence shall be printed exactly as it appears in the input and should be followed by a line break.

    Sample Input

    Hello world! Everyone should greet the entire world in a friendly
    manner. Wouldn’t that make the world a more friendly place?

    This is not a sentence
    ***
    From: The Wright Brothers’ Aeroplane.

    By Orville and Wilbur Wright

    In the field of aviation there were two schools. The first,
    represented by such men as Professor Langley and Sir Hiram Maxim,
    gave chief attention to power flight; the second, represented by
    Lilienthal, Mouillard, and Chanute, to soaring flight. Our sympathies
    were with the latter school, partly from impatience at the wasteful
    extravagance of mounting delicate and costly machinery on wings
    which no one knew how to manage, and partly, no doubt, from the
    extraordinary charm and enthusiasm with which the apostles of soaring
    flight set forth the beauties of sailing through the air on fixed
    wings, deriving the motive power from the wind itself.

    We began our active experiments at the close of this period, in October,
    1900, at Kitty Hawk, North Carolina. Our machine was designed to be
    flown as a kite, with a man on board, in winds from 15 to 20 miles an
    hour. But, upon trial, it was found that much stronger winds were
    required to lift it. Suitable winds not being plentiful, we found it
    necessary, in order to test the new balancing system, to fly the machine
    as a kite without a man on board, operating the levers through cords
    from the ground. This did not give the practice anticipated, but it
    inspired confidence in the new system of balance.

    In the summer of 1901 we became personally acquainted with Mr. Chanute.
    When he learned that we were interested in flying as a sport, and not
    with any expectation of recovering the money we were expending on it, he
    gave us much encouragement. At our invitation, he spent several weeks
    with us at our camp at Kill Devil Hill, four miles south of Kitty Hawk,
    during our experiments of that and the two succeeding years. He also
    witnessed one flight of the power machine near Dayton, Ohio, in October,
    1904.
    ******

    Sample Output

    Everyone should greet the entire world in a friendly
    manner.
    ======
    The first,
    represented by such men as Professor Langley and Sir Hiram Maxim,
    gave chief attention to power flight; the second, represented by
    Lilienthal, Mouillard, and Chanute, to soaring flight.
    Our machine was designed to be
    flown as a kite, with a man on board, in winds from 15 to 20 miles an
    hour.
    When he learned that we were interested in flying as a sport, and not
    with any expectation of recovering the money we were expending on it, he
    gave us much encouragement.
    ======

    Source

    样例输入

    Hello world! Everyone should greet the entire world in a friendly
    manner. Wouldn’t that make the world a more friendly place?

    This is not a sentence
    ***
    From: The Wright Brothers’ Aeroplane.

    By Orville and Wilbur Wright

    In the field of aviation there were two schools. The first,
    represented by such men as Professor Langley and Sir Hiram Maxim,
    gave chief attention to power flight; the second, represented by
    Lilienthal, Mouillard, and Chanute, to soaring flight. Our sympathies
    were with the latter school, partly from impatience at the wasteful
    extravagance of mounting delicate and costly machinery on wings
    which no one knew how to manage, and partly, no doubt, from the
    extraordinary charm and enthusiasm with which the apostles of soaring
    flight set forth the beauties of sailing through the air on fixed
    wings, deriving the motive power from the wind itself.

    We began our active experiments at the close of this period, in October,
    1900, at Kitty Hawk, North Carolina. Our machine was designed to be
    flown as a kite, with a man on board, in winds from 15 to 20 miles an
    hour. But, upon trial, it was found that much stronger winds were
    required to lift it. Suitable winds not being plentiful, we found it
    necessary, in order to test the new balancing system, to fly the machine
    as a kite without a man on board, operating the levers through cords
    from the ground. This did not give the practice anticipated, but it
    inspired confidence in the new system of balance.

    In the summer of 1901 we became personally acquainted with Mr. Chanute.
    When he learned that we were interested in flying as a sport, and not
    with any expectation of recovering the money we were expending on it, he
    gave us much encouragement. At our invitation, he spent several weeks
    with us at our camp at Kill Devil Hill, four miles south of Kitty Hawk,
    during our experiments of that and the two succeeding years. He also
    witnessed one flight of the power machine near Dayton, Ohio, in October,
    1904.
    ******

    样例输出

    Everyone should greet the entire world in a friendly
    manner.
    ======
    The first,
    represented by such men as Professor Langley and Sir Hiram Maxim,
    gave chief attention to power flight; the second, represented by
    Lilienthal, Mouillard, and Chanute, to soaring flight.
    Our machine was designed to be
    flown as a kite, with a man on board, in winds from 15 to 20 miles an
    hour.
    When he learned that we were interested in flying as a sport, and not
    with any expectation of recovering the money we were expending on it, he
    gave us much encouragement.
    ======

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部