I would like to count how many unique words are used in some text. Tricky part is, that I would like to consider different forms of one word as just one word. Example:
I work.
He works.
I am working.
I have worked.
Unique words in this text are just these 5: [I, work, He, am, have] because there are 4 different forms of one (same) word - work.
I quess I need some dictionary for this, or some library, but after some googling didn't find anything. Anybody can help me? Thanks!
PS: I know that some words are exactly same, but their meaning is different. (example: When he leaves home, the leaves will cover the ground). Anyway, just ignore such cases - it's hard to cover them + they are rare and can't significantly affect the result.