Commit 87f8d79b authored by Neeme Kahusk's avatar Neeme Kahusk
Browse files

Lisatud gloss, external_info Variandile

parent a401d6a2
......@@ -101,11 +101,13 @@ class Synset:
class Variant:
def __init__(self, lemma, sense,
gloss=None, examples=[]):
gloss=None, examples=[],
external_info=[]):
self.lemma = lemma
self.sense = sense
self.gloss = gloss
self.examples = examples
self.external_info = external_info
def __str__(self):
out = format_polaris(2, 'LITERAL', self.lemma)
......@@ -113,6 +115,27 @@ class Variant:
format_polaris(3, 'SENSE', self.sense,
None, False)
)
if self.gloss:
out = '{}\n{}'.format(out,
format_polaris(3, 'DEFINITION', self.gloss)
)
if self.examples:
out = '{}\n{}'.format(out,
format_polaris(3,
'EXAMPLES')
)
out = '{}\n{}'.format(out,
'\n'.join([str(i) for i in self.examples])
)
if self.external_info:
out = '{}\n{}'.format(out,
format_polaris(3,
'EXTERNAL_INFO')
)
out = '{}\n{}'.format(out,
'\n'.join([str(i) for i in self.external_info])
)
return out
......
Supports Markdown
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