# -*- coding: utf-8 -*-
import q50, q51
from stemming.porter2 import stem

inputfile = 'nlp.txt'

def get_stem(word):
    return stem(word)

def main(file):
    with open(file, 'r') as f:
        for fr in f.readlines():
            if fr == '\n':
                continue
            fr = q50.sentense_split(fr)
            wr = q51.word_split(fr)
            for w in wr:
                print w, '\t', get_stem(w)

if __name__ == '__main__':
    main(inputfile)
