I am new to python and practising with examples from book.
Can anyone explain why when I am trying to stem some example with this code nothing is changed?
>>> from nltk.stem import PorterStemmer
>>> stemmer=PorterStemmer()
>>> stemmer.stem('numpang wifi stop gadget shopping')
'numpang wifi stop gadget shopping'
But when I do this it works
>>> stemmer.stem('shopping')
'shop'
[stemmer.stem(w) for w in ['numpang', 'wifi', 'stop', 'gadget', 'shopping']]
? If so, thestem
function appears to work on a single word at a time. – Xavierxaviera