fixing tabstops
This commit is contained in:
parent
3fbf5fad68
commit
9f0ef37d80
@ -25,9 +25,10 @@ CONLLU_ATTRIBUTES = [
|
|||||||
|
|
||||||
def replace_tab(s, tabstop=4):
|
def replace_tab(s, tabstop=4):
|
||||||
result = str()
|
result = str()
|
||||||
|
s = s.replace("\t", " \t")
|
||||||
for c in s:
|
for c in s:
|
||||||
if c == '\t':
|
if c == '\t':
|
||||||
while (len(result) % tabstop != 0):
|
while (len(result) % (tabstop) != 0):
|
||||||
result += ' '
|
result += ' '
|
||||||
else:
|
else:
|
||||||
result += c
|
result += c
|
||||||
@ -151,7 +152,7 @@ class ConlluGenerator(object):
|
|||||||
else:
|
else:
|
||||||
stemmed_token = self.stemmer.stem(token)
|
stemmed_token = self.stemmer.stem(token)
|
||||||
collnu_doc.add(ConlluElement(
|
collnu_doc.add(ConlluElement(
|
||||||
id=self.id_counter,
|
id=self.id_counter + 1,
|
||||||
form=token,
|
form=token,
|
||||||
lemma=stemmed_token
|
lemma=stemmed_token
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user