-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.py
33 lines (28 loc) · 833 Bytes
/
demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
from seedling import miniwals
from seedling import udhr, omniglot, odin
# Accessing WALS information
wals = miniwals.MiniWALS()
print wals['eng']
print sorted(wals.LANGUAGEFAMILY.keys())
print wals.LANGUAGEFAMILY['Indo-European']
print wals.GENUS['Germanic']
print sorted(wals.RELATED_LANGS['eng'])
# Accessing UDHR sentences.
print udhr.languages()
print udhr.num_languages()
for lang, sent in udhr.source_sents():
print lang, sent
# Accessing Omniglot sentences.
print omniglot.languages()
print omniglot.num_languages()
for lang, sent, trans in omniglot.phrases():
print lang, sent, trans
# Accessing ODIN sentences.
print odin.languages()
print odin.num_languages()
for lang, sent in odin.source_sents():
print lang, sent
for lang, igts in odin.igts():
for igt in igts:
print lang, igt