def lemmatize_word(lm,word):
    """Lemmatizes a word using the nltk library.
    Since we don't know the part of speech, this method performs 2 lemmatizations (once as a noun and once as a verb)
    The verson of the word that differs from the input word is returned.
    This is not always guaranteed to generate a correct answer, but it's good enough for our purposes.
    """                
    candidateN = lm.lemmatize(word,'n')
    candidateV = lm.lemmatize(word,'v')
    if candidateN == word:
        return candidateV
    else:
        return candidateN