import nltk
def noun_with_adjectives(sentence):
""" selects the first occurrence of a noun in a sentence
with any accompanying adjectives """
tags = nltk.pos_tag(sentence.split(" "))
phrase = []
for tag in tags:
if tag[1] in ["JJ", "JJS", "JJR"]:
phrase.append(tag[0])
if tag[1] in ["NN", "NNS", "NNP"]:
phrase.append(tag[0])
break
return ' '.join(phrase)