Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- # -*- coding: utf-8 -*-
- from sys import stdin
- for line in stdin:
- line = line.strip()
- if line == '':
- print
- else:
- wf, feats, lemma, label, ann = line.split('\t')
- lemma_list = eval(ann)
- l = '|'.join([lemma for label_, lemma in lemma_list if label_==label])
- if l != '':
- lemma = l
- lemma = lemma.lower()
- lemma = lemma.replace('Å', 'å')
- lemma = lemma.replace('Ä', 'ä')
- lemma = lemma.replace('Ö', 'ö')
- print ("%s\t%s\t%s\t%s\t_" % (wf, feats, lemma, label))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement