'Converts a list of whoosh\'s indexed records to LookupResult tuples
containing database objects.'

def _whoosh_records_to_results(self, records, exact=True):

    languages = dict(((row.identifier, row) for row in self.session.query(tables.Language)))
    seen = {}
    results = []
    for record in records:
        seen_key = (record['table'], record['row_id'])
        if (seen_key in seen):
            continue
        seen[seen_key] = True
        cls = self.indexed_tables[record['table']]
        obj = self.session.query(cls).get(record['row_id'])
        results.append(LookupResult(object=obj, indexed_name=record['name'], name=record['display_name'], language=languages[record['language']], iso639=record['iso639'], iso3166=record['iso3166'], exact=exact))
    return results
