bio ptyhon trie
===

Hi have a dictionary word list in bio pythons trie implementation

i have a trie object named t with a huge dictionary loaded into it.

i have a dict map from integers to a alphabet for some odd encryption algorithm

what is the most elegant or pythonic way so when i search the trie, with a 3 letter word , to omit and store all the results longer and shorter then 3 characters ..

say the inputs are 227 and 8733 which are mapped to letters in the dictionary like ([bar,car,carpet][tree,tree's,treed,used]) i only want to keep the outputs as the same length, so when the input is 227 only car and bar will be outputted
the results i'm looking for would be ([bar,car],[tree,used])

heres my code 

    from Bio import trie
    from Bio import triefind
    import StringIO
    import itertools
    
        dictionary = [line.strip() for line in open("/home/user/dictionary.txt",  "rb").readlines()]
        
        t = trie.trie()
        for word in dictionary:
            t[word] = 1
    
        word = []
        words = []
        for input in my_inputs:
            digits = map(int,str(input))
            strings = [''.join(combo) for combo in itertools.product(*(mapping[d] for d in digits))]
            for string in strings:
                word = t.with_prefix(string)
                words.append(word)
                filter (lambda a: a != [], words)

