class String def ends_with?(suffix) !!(self =~ /#{suffix}$/) end def remove_suffix(suffix_size) self[0, self.size - suffix_size] end def stem UEAStemmer.new.stem(self) end end