Commit 3fe99dff authored by Neeme Kahusk's avatar Neeme Kahusk
Browse files

Instance

parent 883b551b
......@@ -191,6 +191,9 @@ class InternalLink:
self.target_concept = target_concept
self.features = features or []
class EqLink(InternalLink):
pass
if __name__ == '__main__':
# print(format_polaris(0, 'WORD_MEANING', record=222))
......
%% Cell type:markdown id: tags:
# Eurown testing
%% Cell type:code id: tags:
``` python
>>> import eurown
>>> a = eurown.Synset(43)
>>> b = eurown.Variant('loom',1)
>>> c = eurown.Variant('elajas',2)
>>> a.add_variant(b)
>>> print(a)
```
%% Output
0 @43@ WORD_MEANING
1 PART_OF_SPEECH "n"
1 VARIANTS
2 LITERAL "loom"
3 SENSE 1
%% Cell type:code id: tags:
``` python
>>> print(b)
```
%% Output
2 LITERAL "loom"
3 SENSE 1
%% Cell type:code id: tags:
``` python
>>> print(c)
```
%% Output
2 LITERAL "elajas"
3 SENSE 2
%% Cell type:code id: tags:
``` python
>>> a.add_variant(c)
>>> print(a)
```
%% Output
0 @43@ WORD_MEANING
1 PART_OF_SPEECH "n"
1 VARIANTS
2 LITERAL "loom"
3 SENSE 1
2 LITERAL "elajas"
3 SENSE 2
%% Cell type:code id: tags:
``` python
>>> a.variants[0].gloss = "elusorganism, mida tavaliselt iseloomustab \
vabatahtliku liikumise võime ja närvisüsteemi olemasolu"
>>> print(a)
```
%% Output
0 @43@ WORD_MEANING
1 PART_OF_SPEECH "n"
1 VARIANTS
2 LITERAL "loom"
3 SENSE 1
3 DEFINITION "elusorganism, mida tavaliselt iseloomustab vabatahtliku liikumise võime ja närvisüsteemi olemasolu"
2 LITERAL "elajas"
3 SENSE 2
%% Cell type:code id: tags:
``` python
d = eurown.Synset(44)
print(d)
```
%% Output
0 @44@ WORD_MEANING
1 PART_OF_SPEECH "n"
%% Cell type:code id: tags:
``` python
d.add_variant(eurown.Variant('elusolend',1))
d.add_variant(eurown.Variant('organism',2))
d.variants[0].gloss = 'elusorganism, hrl. inimene v. loom'
print(d)
```
%% Output
0 @44@ WORD_MEANING
1 PART_OF_SPEECH "n"
1 VARIANTS
2 LITERAL "elusolend"
3 SENSE 1
3 DEFINITION "elusorganism, hrl. inimene v. loom"
2 LITERAL "organism"
3 SENSE 2
%% Cell type:code id: tags:
``` python
snset = eurown.Synset()
print(snset)
```
%% Output
0 WORD_MEANING
1 PART_OF_SPEECH "n"
%% Cell type:code id: tags:
``` python
inst = eurown.Instance()
print(inst)
```
%% Output
0 WORD_INSTANCE
1 PART_OF_SPEECH "pn"
%% Cell type:code id: tags:
``` python
aa = eurown.Variant('Aafrika',1)
inst.add_variant(aa)
print(inst)
```
%% Output
0 WORD_INSTANCE
1 PART_OF_SPEECH "pn"
1 VARIANTS
2 LITERAL "Aafrika"
3 SENSE 1
%% Cell type:code id: tags:
``` python
inst.__dict__
inst.__all__
```
%% Output
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-12-6bcb8e07ba4e> in <module>()
1 inst.__dict__
----> 2 inst.__all__
AttributeError: 'Instance' object has no attribute '__all__'
%% Cell type:code id: tags:
``` python
```
......
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