'Return a list of noun phrases (strings) for body of text.'

def extract(self, sentence):

    if (not self._trained):
        self.train()
    tokens = self._tokenize_sentence(sentence)
    tagged = self.tagger.tag(tokens)
    tags = _normalize_tags(tagged)
    merge = True
    while merge:
        merge = False
        for x in range(0, (len(tags) - 1)):
            t1 = tags[x]
            t2 = tags[(x + 1)]
            key = (t1[1], t2[1])
            value = self.CFG.get(key, u'')
            if value:
                merge = True
                tags.pop(x)
                tags.pop(x)
                match = (u'%s    %s' % (t1[0], t2[0]))
                pos = value
                tags.insert(x, (match, pos))
                break
    matches = [t[0] for t in tags if (t[1] in [u'NNP', u'NNI'])]
    return matches
