Well, it does not exist yet, but it has already been researched on SO, for problems with crosswords.
The essence of the solution I propose was indexing by letter and indexes, which Python gives:
class Index: def __init__(self, list): self.data = defaultdict(set) for word in list: self.add(word) def add(self, word): for l in range(0, len(word)): self.data[(l, word[l])].insert(word) def look(self, letters): """letters is a list of tuples (position, letter)""" result = None for (p,l) in letters: set = self.data[(p,l)] if result == None: result = set else: result = result.insersection(set) return result
The idea is simple: you have a large index that has a set of words for each pair (position,letter) . In your case, this can be expanded to have one index per word length, which will reduce the size of word sets and therefore be faster.
To search, you simply cross all the sets to have a common set of words corresponding to all known letters.
source share