fixing tabstops

This commit is contained in:
Jonas Weinz 2019-06-30 15:20:19 +02:00
parent 3fbf5fad68
commit 9f0ef37d80

View File

@ -25,9 +25,10 @@ CONLLU_ATTRIBUTES = [
def replace_tab(s, tabstop=4):
result = str()
s = s.replace("\t", " \t")
for c in s:
if c == '\t':
while (len(result) % tabstop != 0):
while (len(result) % (tabstop) != 0):
result += ' '
else:
result += c
@ -151,7 +152,7 @@ class ConlluGenerator(object):
else:
stemmed_token = self.stemmer.stem(token)
collnu_doc.add(ConlluElement(
id=self.id_counter,
id=self.id_counter + 1,
form=token,
lemma=stemmed_token
))