def get_pos(tokenlist, pos):
    """ filter a list to return the words that match the provided part of speech"""
    matching_pos_words = []
    i = 0
    for (word, pos_tag) in tokenlist:
        try:
            if pos_tag.startswith(pos):
                matching_pos_words.append((word, i))
        except:
            print('error', word, pos_tag)
        i += 1
    return matching_pos_words