File size: 356 Bytes
0e5da39 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/usr/bin/env python3
import fileinput
import re
lemma_strip = re.compile(r"(?<=.)(?:`|_|-[^0-9]).*$")
for line in fileinput.input():
line = line.rstrip("\n")
columns = line.split("\t")
if not line.startswith("#") and len(columns) == 10:
columns[2] = lemma_strip.sub("", columns[2])
line = "\t".join(columns)
print(line)
|