From 06f3bf5827d4cbf398b5a76cca515f3f5ddb775c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20H=C3=A4m=C3=A4l=C3=A4inen?= Date: Thu, 1 Feb 2018 12:18:08 +0200 Subject: [PATCH] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 7ce2809..a0c1d28 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,16 @@ When models are installed, *generate()*, *analyze()* and *lemmatize()* methods w The return object is a list of tuples. The first item in each tuple is the word form used in the sentence, the second item is a list of *Cg3Word* objects. In the case of a full disambiguation, these lists have only one Cg3Word object, but some times the result of the disambiguation still has some ambiguity. Each Cg3Word object has three variables *lemma*, *form* and *morphology*. + >>disambiguations = cg.disambiguate(tokens) + >> for disambiguation in disambiguations: + ... possible_words = disambiguation[1] + ... for possible_word in possible_words: + ... print possible_word.lemma, possible_word.morphology + Kissa [u'N', u'Prop', u'Sg', u'Nom', u''] + kissa [u'N', u'Sg', u'Nom', u''] + voida [u'V', u'Act', u'Ind', u'Prs', u'Sg3', u''] + nauraa [u'V', u'Act', u'InfA', u'Sg', u'Lat', u''] + ### Lexical information Uralic NLP makes it possible to obtain the information available in sanat.csc.fi entries in JSON format. The information can contain data such as translations, example sentences, semantic tags, morphological information and so on. You have to define the language code of the dictionary.