More German Nouns

View as PDF

Submit solution

Points: 7
Time limit: 1.0s
Memory limit: 64M

Author:
Problem types

Introduction to Unicode

Unfortunately, the students are not very bright and giving them the number of nouns in one line is not enough to help them. To add insult to injury, the ASCII substitution is too hard for them to understand. Hence, the teacher decided to be more direct and ask you to just list all the nouns as they appear in the text. It also saves the effort to convert the text into ASCII.

Input Specification

The first line is the number n (n \in \mathbb N, n \le 100), the number of lines to process. The next n lines are German text, UTF-8 encoded. The text will be formatted to the new, i.e. post-reform, German spelling rules. To make your life easier, we will not capitalize the first letter of each line unless it is a noun, nor will any pronouns be capitalized.

Output Specification

You are to output all the German nouns in the order they appear in the text, encoded as UTF-8. Also, you must not change the nouns in any way, i.e. you must preserve the declension of the noun.

Sample Input

4
doch der Klang seiner Stimme war voll Zärtlichkeit,
so viel Wärme und Trost in jedem Ton!
die Musik jener Nacht trug mich davon.
und so bin ich der Wirklichkeit entflohen.

Sample Output

Klang
Stimme
Zärtlichkeit
Wärme
Trost
Ton
Musik
Nacht
Wirklichkeit

Comments


  • 1
    TypicalToxic  commented on Oct. 27, 2016, 1:18 a.m. edited

    We are to output German Nouns. A noun is when the first letter is capitalized. Judging by the input and output, we also remove punctuations " ."?!'():; " etc?. Zärtlichkeit, -> Zärtlichkeit

    Would we output:

    teSt -> teSt | Öest -> Öest | ..Test.. -> Test | teÖst -> teÖst |Te.st -> Test |


    • 1
      quantum  commented on Oct. 27, 2016, 3:02 a.m.

      Test cases are legit German text.


  • 2
    println_hi_  commented on Oct. 25, 2016, 11:08 a.m.

    Can I please have a hint on how to do unicode input in python 3? My code works on my personal machine but not for yours.


  • 0
    Yuting9  commented on April 4, 2015, 12:50 a.m.

    Is the sample input and output in UTF-8? If not, can it be?


    • 0
      quantum  commented on April 4, 2015, 4:05 a.m.

      Sample input is a bunch of Unicode characters. It depends on the programs you are using whether they are handled as UTF-8 bytes.


  • 0
    omaewamoushindeiru  commented on Feb. 16, 2015, 4:22 a.m.

    French dictionary + (int) provides a nice meme.


  • 2
    Xyene  commented on Feb. 16, 2015, 3:45 a.m.

    In an effort to speed up general IO for Java submissions, the DMOJ swaps out the standard System.out with a highly-buffered, ASCII stream (see https://github.com/DMOJ/judge/blob/master/java_executor/src/ca/dmoj/java/UnsafePrintStream.java#L22).

    If you're submitting in Java, you'll have to wrap the System.out stream with a UTF-8 encoding, like new PrintStream(System.out, "UTF-8").