#B3759. Text Language Classification
Text Language Classification
Text Language Classification
This problem is a simple text classification task. Although it falls under the "artificial intelligence" category, you can think of the classification as a function \( f \) that takes an input text and returns either 0 or 1. In this problem, your function will classify the input text as either written in English or written in Chinese Pinyin.
More formally, you are given a string \( x \). Your task is to output:
- 0 if \( x \) is written in English.
- 1 if \( x \) is written in Chinese Pinyin.
Note that although both English and Pinyin use the Latin alphabet, the Pinyin text in this problem may include non-ASCII punctuation (for example, the character 、
) or other non-ASCII symbols. You can use this fact to distinguish a Pinyin text from an English text.
For example, consider the two texts below:
- English text: "While a number of definitions of artificial intelligence (AI) have surfaced over the last few decades, John McCarthy offers the following definition ..."
- Pinyin text: "Ren gong zhi neng shi yan jiu、kai fa yong yu mo ni、yan shen he kuo zhan ren.de zhi neng de li lun、fang fa ji ying yong xi tong de yi men xin de ji shu ke xue."
Your program should output 0 for the English text and 1 for the Pinyin text.
inputFormat
The input consists of a single line containing a sequence of words. The text will be either in English or in Chinese Pinyin.
outputFormat
Output a single integer. Output 0 if the text is in English, and output 1 if the text is in Chinese Pinyin.
sample
While a number of definitions of artificial intelligence (AI) have surfaced over the last few decades, John McCarthy offers the following definition in his paper.
0