#C273. Remove Stopwords from Text
Remove Stopwords from Text
Remove Stopwords from Text
Given a sentence and a list of stopwords, remove all occurrences of the stopwords from the sentence.
A word is removed if its lowercased form, after stripping any leading or trailing punctuation symbols .,!?;:'"
, matches one of the provided stopwords.
You should read the input from stdin and write the cleaned text to stdout. The input consists of two lines: the first line is the text, and the second line contains the stopwords separated by spaces.
For example, if the input text is "This is an example of text processing." and the stopwords are "this is an of to the", the result should be "example text processing."
inputFormat
The input is given via standard input in two lines:
- The first line contains the sentence (text) to process.
- The second line contains the stopwords separated by spaces.
outputFormat
Output a single line containing the text after all stopwords have been removed. The remaining words should be output in their original order, separated by a single space.
## sampleThis is an example of text processing.
this is an of to the
example text processing.