Commit e4671b10 authored by Tomasz Walkowiak's avatar Tomasz Walkowiak

formatting

parent d200b140
Pipeline #663 passed with stages
in 1 minute and 50 seconds
......@@ -18,7 +18,6 @@ class Model:
self.synsets = {}
if len(path) > 0:
self.read(path)
#print(self.synsets)
print("New model")
def read(self, path):
......@@ -29,7 +28,6 @@ class Model:
ws = wb.active
num = 0
for row in ws.iter_rows():
#print(num)
if num == 0:
num += 1
continue
......@@ -38,8 +36,6 @@ class Model:
if lemma is None or tag is None:
continue
var = row[1].value
synset = row[3].value if len(row) > 3 else None
if synset is not None:
self.synsets[str(synset)] = tag
......@@ -55,7 +51,7 @@ class Model:
class Category:
"""Category."""
def __init__(self,verbose=False):
def __init__(self, verbose=False):
"""Initialize Category."""
self.model = {}
self.modelpath = ""
......@@ -96,8 +92,8 @@ class Category:
if id in model.synsets:
self.inc(stat, model.synsets[id])
if self.verbose:
print("Synset %s, category %s" %
(id,model.synsets[id]))
print("Synset %s, category %s" % (id,
model.synsets[id]))
found = True
break
......@@ -109,21 +105,20 @@ class Category:
if el in model.variants:
self.inc(stat, model.variants[el])
if self.verbose:
print("Variant %s, category %s" %
(el,model.variants[el]))
print("Variant %s, category %s" % (el,
model.variants[el]))
found = True
break
if found:
break
if not found:
if base in model.lemmas:
self.inc(stat, model.lemmas[base])
if self.verbose:
print("Base %s, category %s" %
(base, model.lemmas[base]))
print("Base %s, category %s" % (base,
model.lemmas[base]))
if self.verbose:
print(stat)
with open(outputFile, "w") as f:
......@@ -133,7 +128,7 @@ class Category:
def main():
"""Runs the program."""
cat = Category(verbose=True)
cat.process("../test/test2.ccl", {"path": "/test/test.xlsx"},
cat.process("../test/test1.ccl", {"path": "/test/test.xlsx"},
"../test/test1_out.json", "..")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment