Q4Single correct5 Marks22 Dec 2024
The following pseudocode is executed using the "Words" dataset. Let unique(L) return the list of unique elements of L. At the end of the execution, wCount represent dictionary with words as keys mapped to the number of sentences in which the word is present. Choose the correct code fragment to complete the pseudocode.
Ignore the upper and lower case, and punctuation symbols while comparing with other words.
wList = []
wCount = {}
while(Table 1 has more rows){
Read the first row X from Table 1
wList = wList ++ [X.Word]
if(X.Word ends with a full stop){
uniqueList = unique(wList)
foreach word in uniqueList{
********************
* Fill the code *
********************
}
wList = []
}
Move X to table 2
}
Topic Mapping: chapter: Week 6 │ topic: Dictionary — Applications │ subtopic: Sentence-wise frequency counting of words using a dictionary and unique list filtering