EMPTY COMMIT - fixing some pylint warnings
This commit is contained in:
parent
9117734b91
commit
6a9ee516a3
20
wani.py
20
wani.py
|
@ -249,7 +249,6 @@ class WordFormMsdCR(WordFormAnyCR):
|
|||
return False
|
||||
|
||||
return True
|
||||
pass
|
||||
|
||||
def add_word(self, word):
|
||||
if self.lemma is None:
|
||||
|
@ -366,9 +365,6 @@ class ComponentRendition:
|
|||
else:
|
||||
raise NotImplementedError("Representation selection: {}".format(feature))
|
||||
|
||||
else:
|
||||
return None
|
||||
|
||||
def cr_instance(self, word_renderer):
|
||||
return self.representation_factory(self.more, word_renderer)
|
||||
|
||||
|
@ -408,7 +404,7 @@ class ComponentRendition:
|
|||
|
||||
for cid, reps in representations.items():
|
||||
reps = [rep.rendition_text for rep in reps]
|
||||
if len(reps) == 0:
|
||||
if reps == []:
|
||||
pass
|
||||
elif all(r is None for r in reps):
|
||||
matches.representations[cid] = None
|
||||
|
@ -850,7 +846,7 @@ class Word:
|
|||
assert None not in (self.id, self.lemma, self.msd)
|
||||
|
||||
@staticmethod
|
||||
def pcWord(pc, do_msd_translate):
|
||||
def pc_word(pc, do_msd_translate):
|
||||
pc.set('lemma', pc.text)
|
||||
pc.set('msd', "N" if do_msd_translate else "U")
|
||||
return Word(pc, do_msd_translate)
|
||||
|
@ -912,7 +908,7 @@ class WordMsdRenderer:
|
|||
self.frequent_words[lemma].append((msd, txt, n))
|
||||
|
||||
lf = self.lemma_features
|
||||
for lemma in self.lemma_msd.keys():
|
||||
for lemma in self.lemma_msd:
|
||||
cmsd = self.lemma_msd[lemma]
|
||||
if cmsd[0] in lf:
|
||||
self.lemma_msd[lemma] = "".join(
|
||||
|
@ -992,7 +988,7 @@ def load_tei_file(filename, skip_id_check, do_msd_translate, pc_tag, status):
|
|||
for w in et.iter("w"):
|
||||
words[w.get('id')] = Word(w, do_msd_translate)
|
||||
for pc in et.iter(pc_tag):
|
||||
words[pc.get('id')] = Word.pcWord(pc, do_msd_translate)
|
||||
words[pc.get('id')] = Word.pc_word(pc, do_msd_translate)
|
||||
|
||||
for l in et.iter("link"):
|
||||
if 'dep' in l.keys():
|
||||
|
@ -1083,9 +1079,11 @@ class Writer:
|
|||
|
||||
try:
|
||||
int(rows[0][self.sort_by])
|
||||
key=lambda row: int(row[self.sort_by])
|
||||
def key(row):
|
||||
return int(row[self.sort_by])
|
||||
except ValueError:
|
||||
key=lambda row: row[self.sort_by].lower()
|
||||
def key(row):
|
||||
return row[self.sort_by].lower()
|
||||
|
||||
return sorted(rows, key=key, reverse=self.sort_order)
|
||||
|
||||
|
@ -1118,7 +1116,7 @@ class Writer:
|
|||
|
||||
rows.append(to_write)
|
||||
|
||||
if len(rows) > 0:
|
||||
if rows != []:
|
||||
rows = self.sorted_rows(rows)
|
||||
file_handler.write("\n".join([", ".join(row) for row in rows]) + "\n")
|
||||
file_handler.flush()
|
||||
|
|
Loading…
Reference in New Issue
Block a user