Given a text. The task is to count number of sentences and words in text.
Definition of a sentence :- Sentences are defined as contiguous strings of characters ending in an end of sentence punctuation (. ! or ?) or the last contiguous set of characters in the string, even if they don't end with a punctuation mark.
Definition of a word :- "Words" are defined as contiguous strings of alphabetic characters i.e. any upper or lower case characters a-z or A-Z
The first line contains a single integer T denoting the number of test cases. Then T test cases follow. Each test case consists of a single line which contains a text.
Corresponding to each test case, print space separated number of sentences and words.
1 <=T<= 100
0 <= |text| <= 250
where |text| denoted the length of text
many??? Sentences are
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.