I do a little linguistics as a hobby while working of my own software development projects. I am wondering if there is a database or online api where I can easily establish the possible "parts of speech" for a given word from within my code. So for example:
getPartOfSpeech("papa")
returns ["noun"]
. And if a word has multiple parts of speech associated with it then multiple values are returned by the function with the most common association listed first. I program in python put can a number of other languages also.