'Remove data for all docnames not in the list.'

def prune(self, docnames):

    new_titles = {}
    new_filenames = {}
    for docname in docnames:
        if (docname in self._titles):
            new_titles[docname] = self._titles[docname]
            new_filenames[docname] = self._filenames[docname]
    self._titles = new_titles
    self._filenames = new_filenames
    for wordnames in itervalues(self._mapping):
        wordnames.intersection_update(docnames)
    for wordnames in itervalues(self._title_mapping):
        wordnames.intersection_update(docnames)
