title: extracting from a tagged corpus in python
body: <p>hi i'm trying exract proper noun from a tagged corpus, lets say for example- from the nltk tagged corpus brown i'm trying to extract the words only tagged with "NP".</p>
  
  <p>my code:</p>
  
  <pre><code>  import nltk
    from nltk.corpus import brown
    f = brown.raw('ca01')
    print nltk.corpus.brown.tagged_words()
    w=[nltk.tag.str2tuple(t) for t in f.split()]
    print w
  </code></pre>
  
  <p>but it is not showing the words istead it is showing only </p>
  
  <p>[]</p>
  
  <p>sample output:</p>
  
  <pre><code>    [('The', 'AT'), ('Fulton', 'NP-TL'), ...]
      []
  </code></pre>
  
  <p>why is it??</p>
  
  <p>thanks.</p>
  
  <p>I i only prit f.split()..then i get</p>
  
  <pre><code>             [('The', 'AT'), ('Fulton', 'NP-TL'), ('County', 'NN-TL'), ('Grand', 'JJ-TL'), ('Jury', 'NN-TL'), ('said', 'VBD'), ('Friday', 'NR'), ('an', 'AT'), ('investigation', 'NN'), ('of', 'IN'), ("Atlanta's", 'NP$'), ('recent', 'JJ'), ('primary', 'NN'), ('election', 'NN'), ('produced', 'VBD'), ('``', '``'), ('no', 'AT'), ('evidence', 'NN'), ("''", "''"), ('that', 'CS'), ('any', 'DTI'), ('irregularities', 'NNS'), ('took', 'VBD'), ('place', 'NN'), ('.', '.'), ('The', 'AT'), ('jury', 'NN'), ('further', 'RBR'), ('said', 'VBD'), ('in', 'IN'), ('term-end', 'NN'), ('presentments', 'NNS'), ('that', 'CS'), ('the', 'AT'), ('City', 'NN-TL').....
  </code></pre>