Lab1 - niCEnANi/RealTimeBigData GitHub Wiki
Lab1 Assignmnet:
Sentence count & sort program in scala using IntelliJ
Step1: It takes entire input file and store in input variable.
Sample input: Hi,I am Naresh. I love India.I love India.I love India.I love India. I am from Telangana.I am from Telangana.I am from Telangana. An apple a day keeps the doctor away.An apple a day keeps the doctor away.
Step2: i) It splits the entire text when it encounters dot(.). So all the sentences will be separated.
ii) And then each sentence will be counted as 1.
Step3: i) The reduceByKey is used to add the count if it encounters same sentences.so the final output will be count of sentences present in text.
ii) The output is sorted using sortedByKey. The output is sorted in alphabetical order.
Sample output: