title: Too many values to unpack in Python dictionary value split()?
body: <p>I have a dictionary called <code>speech_dict</code> where <code>key</code> is a file's name and <code>value</code> is a speech (usually about 10,000 words). I'm trying to get the stem of each word; this is accomplished through some functions in the <code>nltk</code> module. Here's the code I have:</p>
  
  <pre><code>from __future__ import print_function
  from nltk.stem import *
  from nltk.stem.snowball import SnowballStemmer
  
  stemmer = SnowballStemmer("english")
  
  spee_dict = speech_dict
  
  for key,value in spee_dict:
      for i in value.split():
          i = stemmer.stem(i)
          i = i.decode('utf-8')
          spee_dict[key].add(i)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <p><code>ValueError: too many values to unpack</code></p>
  
  <p>There are about 900 keys stored in <code>speech_dict</code>, and about 3.5 million words total to go through. How can I make this work?</p>
  
  <p>Edit: </p>
  
  <p>Alright, Delgan helped me add the stemmed word. How can I remove the original word, now?</p>
  
  <p>I have this: </p>
  
  <pre><code>for key,value in spee_dict.items():
      for i in value.split():
          i_stemmed = stemmer.stem(i)
          i_stemmed = i_stemmed.decode('utf-8')
          spee_dict[key] += i_stemmed
          spee_dict[key] - I
  </code></pre>
  
  <p>But the <code>-</code> operand isn't supported by Unicode.</p>