CCC '11 S1 - English or French? Canadian Computing Competition: 2011 Stage 1, Senior #1 You would like to do some experiments in natural language processing. Natural language processing (NLP) involves...


Only write it in python language


CCC '11 S1 - English or French?<br>Canadian Computing Competition: 2011 Stage 1, Senior #1<br>You would like to do some experiments in natural language processing. Natural language processing (NLP)<br>involves using machines to recognize human languages.<br>Your first idea is to write a program that can distinguish English text from French text.<br>After some analysis, you have concluded that a very reasonable way of distinguishing these two languages is to<br>compare the occurrences of the letters t and T to the occurrences of the letters s and S. Specifically:<br>• if the given text has more t and T characters than s and s characters, we will say that it is<br>(probably) English text;<br>if the given text has more s and s characters than t and T characters, we will say that it is<br>(probably) French text;<br>• if the number of t and T characters is the same as the number of 5 and s characters, we will say<br>that it is (probably) French text.<br>Input Specification<br>The input will contain the number N (0 < N < 10000) followed by N lines of text, where each line has at least<br>one character and no more than 100 characters.<br>Output Specification<br>Your output will be one line. This line will either consist of the word English (indicating the text is probably English)<br>or French (indicating the text is probably French).<br>Sample Input 1<br>Соpy<br>3<br>The red cat sat on the mat.<br>Why are you so sad cat?<br>Don't ask that.<br>Output for Sample Input 1<br>Copy<br>English<br>

Extracted text: CCC '11 S1 - English or French? Canadian Computing Competition: 2011 Stage 1, Senior #1 You would like to do some experiments in natural language processing. Natural language processing (NLP) involves using machines to recognize human languages. Your first idea is to write a program that can distinguish English text from French text. After some analysis, you have concluded that a very reasonable way of distinguishing these two languages is to compare the occurrences of the letters t and T to the occurrences of the letters s and S. Specifically: • if the given text has more t and T characters than s and s characters, we will say that it is (probably) English text; if the given text has more s and s characters than t and T characters, we will say that it is (probably) French text; • if the number of t and T characters is the same as the number of 5 and s characters, we will say that it is (probably) French text. Input Specification The input will contain the number N (0 < n="">< 10000)="" followed="" by="" n="" lines="" of="" text,="" where="" each="" line="" has="" at="" least="" one="" character="" and="" no="" more="" than="" 100="" characters.="" output="" specification="" your="" output="" will="" be="" one="" line.="" this="" line="" will="" either="" consist="" of="" the="" word="" english="" (indicating="" the="" text="" is="" probably="" english)="" or="" french="" (indicating="" the="" text="" is="" probably="" french).="" sample="" input="" 1="" соpy="" 3="" the="" red="" cat="" sat="" on="" the="" mat.="" why="" are="" you="" so="" sad="" cat?="" don't="" ask="" that.="" output="" for="" sample="" input="" 1="" copy="">

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here