I wrote some basic program and I want extract lemma for Polish words what is very important since Polish use inflection.
I was create simple program to load data and convert word into lemma but not know how to do it:
from nltk import corpus
pl = corpus.pl196x
print dir(pl)
print iter(pl.tagged_words()).next()
For example I want do such lemmatization (ignore that some lemmatization can be ambiguous - it is normal in Polish):
kot, kota, kota, kotu, kotem, kocie, kocie == kot (singular male)
kotka, kotki, kotkę, kotce, kotką, kotce, kotka == kot (singular female!)
kociątko, kociątka, kociątko, kociątku, kociątkiem, kociątku, kociątko == kot (singular neutral)
etc. (plural males, plural females, plural neutrals)
How to use pl196x to do such job in or nltk.
Source data for corpus contains such inflections and lemmas - so it is possible but how to access it:
<w id="pu147125" lemma="kot" ana="SSNA---------P">kot</w>
<w id="pr021633" lemma="kot" ana="SSAA---------P">kota</w>
etc.