polimorf_lemmatizer.py
327 Bytes
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys, pickle
dictionary = pickle.load(open("polimorf_lemmatizer.bin", "rb" ))
with open(sys.argv[1]) as in_file:
for line in in_file:
print(' '.join([dictionary[token] if token in dictionary else token for token in line.split()]))
print(line.rstrip())