title: How to get JJ and NN (adjective and Noun) from the triples generated StanfordDependencyParser with NLTK?
body: <p>i got triples using the following code, but i want to get nouns and adjective from tripples, i tried alot but failed, new to NLTK and python, any help ?</p>
  
  <pre><code>from nltk.parse.stanford import StanfordDependencyParser
  dp_prsr= StanfordDependencyParser('C:\Python34\stanford-parser-full-2015-04-20\stanford-parser.jar','C:\Python34\stanford-parser-full-2015-04-20\stanford-parser-3.5.2-models.jar', model_path='edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz')
  word=[]
  s='bit is good university'
  sentence = dp_prsr.raw_parse(s)
  for line in sentence:
      print(list(line.triples()))
  </code></pre>
  
  <p>[(('university', 'NN'), 'nsubj', ('bit', 'NN')), (('university', 'NN'), 'cop', ('is', 'VBZ')), (('university', 'NN'), 'amod', ('good', 'JJ'))]</p>
  
  <p>i want to get university and good and BIT and universityi tried the following but couldnt work.</p>
  
  <pre><code>   for line in sentence:
      if (list(line.triples)).__contains__()  == 'JJ':
         word.append(list(line.triples()))
     print(word)
  </code></pre>
  
  <p>but i get empty array... please any help.</p>