words = self.tag.split
words.each { |word| word = word.stem }
self.tag = words.join(' ')
For a given sentence I want to perform the stem
action on each individual word.
Is there a way to simplify this code?
self.tag = self.tag.split.map(&:stem).join(' ')
self.tag = self.tag.split.collect { |w| word.stem }.join(' ')
Not that I necessarily recommend doing so.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With