def noun_loc(word_set):
    loc = []
    pos = nltk.pos_tag(word_set)
    rs = rhyme_scheme.split('_')
    if len(rs) > 2:
        if rs[2] == 'n':
            for i in range(len(word_set)):
                if pos[i][1] in ['NN', 'NNS', 'NNP', 'NNPS']:
                    loc.append(i)
                else:
                    pass
        elif rs[2] == 'v':
            for i in range(len(word_set)):
                if pos[i][1] in ['VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ']:
                    loc.append(i)
                else:
                    pass
    else:
        for i in range(len(word_set)):
            if pos[i][1] in ['NN', 'NNS', 'NNP', 'NNPS']:
                loc.append(i)
            else:
                pass

    # diagnostic...
    #print pos
    #print loc
    # ...diagnostic

    return loc
dataset/ETHPy150Open rossgoodwin/sonnetizer/sonnetizer_n.py/noun_loc/original