title: NLTK perceptron tagger "TypeError: 'LazySubsequence' object does not support item assignment"
body: <p>I would like to try and use the <code>PerceptronTagger</code> in the <code>nltk</code> package for Python 3.5, But I am getting the error <code>TypeError: 'LazySubsequence' object does not support item assignment</code></p>
  
  <p>I would like to train it with data from the brown corpus with the <code>universal</code> tagset.</p>
  
  <p>Here is the code I am running when I have the issue.</p>
  
  <pre><code>import nltk,math
  tagged_sentences = nltk.corpus.brown.tagged_sents(categories='news',tagset='universal')
  i = math.floor(len(tagged_sentences)*0.2)
  testing_sentences = tagged_sentences[0:i]
  training_sentences = tagged_sentences[i:]
  perceptron_tagger = nltk.tag.perceptron.PerceptronTagger(load=False)
  perceptron_tagger.train(training_sentences)
  </code></pre>
  
  <p>It won't train correctly, and gives the following stack trace.</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-10-61332d63d2c3&gt; in &lt;module&gt;()
        1 perceptron_tagger = nltk.tag.perceptron.PerceptronTagger(load=False)
  ----&gt; 2 perceptron_tagger.train(training_sentences)
  
  /home/nathan/anaconda3/lib/python3.5/site-packages/nltk/tag/perceptron.py in train(self, sentences, save_loc, nr_iter)
      192                     c += guess == tags[i]
      193                     n += 1
  --&gt; 194             random.shuffle(sentences)
      195             logging.info("Iter {0}: {1}/{2}={3}".format(iter_, c, n, _pc(c, n)))
      196         self.model.average_weights()
  
  /home/nathan/anaconda3/lib/python3.5/random.py in shuffle(self, x, random)
      270                 # pick an element in x[:i+1] with which to exchange x[i]
      271                 j = randbelow(i+1)
  --&gt; 272                 x[i], x[j] = x[j], x[i]
      273         else:
      274             _int = int
  
  TypeError: 'LazySubsequence' object does not support item assignment
  </code></pre>
  
  <p>It seems to be coming from the <code>shuffle</code> function in the <code>random</code> module but that doesn't really seem right.</p>
  
  <p>Is there something else that could cause the problem? 
  Has someone had this issue? </p>
  
  <p>I am running this on Ubuntu 16.04.1 with Anaconda Python 3.5. The <code>nltk</code> version is <code>3.2.1</code></p>