2

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.

  • You could probably use an aspell or hunspell dictionary as the basis for a destemmer. Then you could use Wiktionary data for the base word – user0721090601 Dec 10 '16 at 15:28
2

POS-tagging is more complicated than giving it an input word - and get the POS tag as an output. This is because of the ambiguity of the language itself (for example, the word "mine" can be a verb, but also a noun). So, it depends from the context in which it appears within the sentence. The best way to do this, is to give a whole sentence as an input, and get the POS tags of each word as an output, and then get the tag you need from the sentence.

For a POS tagger, you can use the Stanford CoreNLP pipeline, which also includes a POS tagger (they have for Spanish as well). As far as I know, NLTK also has Spanish support, so you might use that toolkit as well.

Another thing you can use is BabelNet "a multilingual lexicalized semantic network and ontology". By using their API, you can get a lot of information about a word (including the POS tag).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.