Given a text, determine the language it is written in. The possible languages are: English, Danish, Romanian and Hungarian. You are not allowed read additional files (e.g. to train your program) so please encode any data in your program. The The shortest program wins.
Some examples of text ifin each language can be found at Project Gutenberg
- English http://www.gutenberg.org/cache/epub/2600/pg2600.txt
- Danish http://www.gutenberg.org/cache/epub/12167/pg12167.txt
- Romanian http://www.gutenberg.org/files/11756/11756-0.txt
- Hungarian http://www.gutenberg.org/files/30163/30163-0.txt
You are required to include examples of runs on other text files exceptother than the ones provided here.
The input file name is given as a command line argument. Except the input text, you are not allowed read additional files (e.g. to train your program) so please encode any data in your program.
Your program must output on of the following words English, Danish, Romanian, Hungarian.
Examples
$ ./language pg2600.txt
English
$ ./langauge pg12167.txt
Danish
$ ./language 11756-0.txt
Romanian
$ ./language 30163-0.txt
Hungarian