added word index processing for spam classification