def enumerate_chunks (phrase, spacy_nlp):
if (len(phrase) > <NUM_LIT:1>):<EOL><INDENT>found = False<EOL>text = "<STR_LIT:U+0020>".join([rl.text for rl in phrase])<EOL>doc = spacy_nlp(text.strip(), parse=True)<EOL>for np in doc.noun_chunks:<EOL><INDENT>if np.text != text:<EOL><INDENT>found = True<EOL>yield np.text, find_chunk(phrase, np.text.split("<STR_LIT:U+0020>"))<EOL><DEDENT><DEDENT>if not found and all([rl.pos[<NUM_LIT:0>] != "<STR_LIT:v>" for rl in phrase]):<EOL><INDENT>yield text, phrase<EOL><DEDENT><DEDENT>
iterate through the noun phrases