Examples (Greek) - abuccts/wiktionary-lookup GitHub Wiki
Examples for Greek Words
Create an instance of Wiktionary
class first and set lang
parameter to "Greek"
,
>>> from pprint import pprint
>>> from pywiktionary import Wiktionary
>>> wikidict = Wiktionary(lang="Greek", CMUBET=False)
>>> word = wikidict.lookup("ελληνικά")
>>> pprint(word)
{'Greek': {'Part of Speech': ['Noun', 'Adjective'],
'Pronunciation': [{'IPA': (['[eliniˈka]'], 'el')}]}}
>>> word = wikidict.lookup("εσπεράντο")
>>> pprint(word)
{'Greek': {'Part of Speech': ['Noun'],
'Pronunciation': [{'IPA': (['/ɛs.pɛ.ˈɾan.dɔ/'], 'el')}]}}
>>> word = wikidict.lookup("γέρος")
>>> pprint(word)
{'Greek': {'Part of Speech': ['Noun'],
'Pronunciation': [{'IPA': (['/ˈʝeɾos/'], 'el')}]}}
To get a short list of phonemes only, set phoneme_only
parameter to True
,
>>> word_phoneme = wikidict.lookup("γέρος", phoneme_only=True)
>>> pprint(word_phoneme)
{'IPA': ['/ˈʝeɾos/']}