#K58502. Taco Sentiment Analysis
Taco Sentiment Analysis
Taco Sentiment Analysis
Implement a sentiment analysis system that processes a string of product reviews separated by periods and returns the count of positive, negative, and neutral reviews.
A review is considered positive if it contains any of the words in the set \(P = \{\mathtt{good},\ \mathtt{excellent},\ \mathtt{awesome},\ \mathtt{fantastic},\ \mathtt{lovely}\}\). If it is not positive and contains any word from the set \(N = \{\mathtt{bad},\ \mathtt{terrible},\ \mathtt{awful},\ \mathtt{horrible},\ \mathtt{poor}\}\), then it is considered negative. Otherwise, the review is neutral. Reviews are analyzed in a case-insensitive manner and extra whitespace should be ignored.
inputFormat
The input is a single string provided via standard input (stdin) that contains multiple product reviews separated by periods.
outputFormat
Output a dictionary as a string with keys 'positive', 'negative', and 'neutral' representing the counts of each sentiment. The output should be printed to standard output (stdout).## sample
This product is good. It is excellent. Absolutely fantastic!
{"positive": 3, "negative": 0, "neutral": 0}