'Feed a doctree to the index.'

def feed(self, filename, title, doctree):

    self._titles[filename] = title
    visitor = WordCollector(doctree)
    doctree.walk(visitor)
    def add_term(word, prefix='', stem=self._stemmer.stem):
        word = stem(word)
        if ((len(word) < 3) or (word in stopwords) or word.isdigit()):
            return
        self._mapping.setdefault((prefix + word), set()).add(filename)
    for word in word_re.findall(title):
        add_term(word)
    for word in visitor.found_words:
        add_term(word)
