I'm try to tag a single word with the nltk pos tagger:
word = "going"
pos = nltk.pos_tag(word)
print pos
But the output is this:
[('g', 'NN'), ('o', 'VBD'), ('i', 'PRP'), ('n', 'VBP'), ('g', 'JJ')]
It's tagging each letter rather than just the one word.
What can I do to make it tag the word?
nltk.tag.pos_tag
accepts a list of tokens, separate and tags its elements. Therefore you need to put your words in an iterable like list:
>>> nltk.tag.pos_tag(['going'])
[('going', 'VBG')]