

def norm_words(words):
    if (not args.no_lowercase):
        words = (w.lower() for w in words)
    if (not args.punctuation):
        words = (w.strip(string.punctuation) for w in words)
        words = (w for w in words if w)
    if stopset:
        words = (w for w in words if (w.lower() not in stopset))
    if (not isinstance(words, list)):
        words = list(words)
    if args.ngrams:
        return functools.reduce(operator.add, [(words if (n == 1) else list(ngrams(words, n))) for n in args.ngrams])
    else:
        return words

dataset/ETHPy150Open japerk/nltk-trainer/train_classifier.py norm_words/original