title: Generate words of varying length give n number of characters
body: <p>I need to generate all possible words of Ki lengths given n characters for example: </p>
  
  <p>given </p>
  
  <p>LNDJOBEAWRL</p>
  
  <p>do 
  bear</p>
  
  <p>I cant come up with the word of len 5 but this is the idea</p>
  
  <pre><code>n = 11
  k1 = 2
  k2 = 4
  k3 = 5 
  </code></pre>
  
  <p>So basically all words of length 2 4 and 5 but without reusing characters. What would be the best way to do it?</p>
  
  <hr>
  
  <p>My dictionary structure looks likes this:</p>
  
  <pre><code>{
      3: [{u'eit': u' "eit":0'}], 
      5: [{u'doosw': u' "woods": 4601, '}, {u'acenr': u' "caner": 0, '}, {u'acens': u' "canes": 0, '}, {u'acden': u' "caned": 0, '}, {u'aceln': u' "canel": 0,'}], 
      6: [{u'abeill': u' "alible": 0, '}, {u'cdeeit': u' "deciet":0,'}, {u'demoor': u' "mooder": 0, '}], 
      7: [{u'deiprss': u' "spiders": 0, '}, {u'deiprsy': u' "spidery": 0, '}, {u'cersttu': u' "scutter": 0, '}], 
      8: [{u'chiiilst': u' "chilitis": 0, '}, {u'agilnrtw': u' "trawling": 0, '}, {u'abdeemns': u' "beadsmen": 0, '}], 
      9: [{u'abeiilnns': u' "biennials": 0, '}, {u'bclooortu': u' "oblocutor": 0, '}, {u'aabfiinst': u' "fabianist": 0, '}, {u'acdeiituz': u' "diazeutic": 0, '}, {u'aabfiimns': u' "fabianism": 0, '}, {u'ehnoooppt': u' "optophone": 0, '}], 
      10: [{u'aiilnoprtt': u' "tripolitan": 0, '}, {u'eeilprrsty': u' "sperrylite": 0, '}, {u'gghhiilttt': u' "lighttight": 0, '}, {u'aeegilrruz': u' "regularize": 0, '}, {u'ellnprtuuy': u' "purulently": 0, '}], 
      11: [{u'cdgilnoostu': u' "outscolding": 0, '}], 
      12: [{u'ceeeilnostuy': u' "leucosyenite": 0, '}, {u'aacciloprsst': u' "sarcoplastic": 0, '}], 
      13: [{u'acdeimmoprrsu': u' "cardiospermum": 0, '}, {u'celnnooostuvy': u' "noncovetously": 0, '}], 
      14: [{u'adeejmnnoprrtu': u' "preadjournment": 0, '}]
  }
  </code></pre>
  
  <p>And my modified code looks like this: </p>
  
  <pre><code>wlen = self.table[pos]
  if pos == 0:
      # See if the letters remaining in the bag are a valid word
      key = ''.join(sorted(bag.elements()))
  
      for d in wlen:
          if key in d.keys():
              yield solution + [key]
  else:
      pos -= 1
      for dic in wlen:
          print(len(dic))
          for key in dic.keys():
  </code></pre>