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 (), the number of lines to process. The next 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
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 |
Test cases are legit German text.
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.
Is the sample input and output in UTF-8? If not, can it be?
Sample input is a bunch of Unicode characters. It depends on the programs you are using whether they are handled as UTF-8 bytes.
French dictionary + (int) provides a nice meme.
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, likenew PrintStream(System.out, "UTF-8")
.