code: def _getPhrase( self, i, sentence, NPlabels ):
          ''' Fetches the full length phrase from the position i
              based on the existing NP phrase annotations (from 
              NPlabels);
              Returns list of sentence tokens in the phrase, and 
              indices of the phrase;
          ''' 
          phrase  = []
          indices = []
          if 0 <= i and i < len(sentence) and NPlabels[i] == 'B':
              phrase  = [ sentence[i] ]
              indices = [ i ]
              j = i + 1
              while ( j < len(sentence) ):
                  if NPlabels[j] in ['B', '']:
                      break
                  else:
                      phrase.append( sentence[j] )
                      indices.append( j )
                  j += 1
          return phrase, indicef _getPhrase( self, i, sentence, NPlabels ):
          ''' Fetches the full length phrase from the position i
              based on the existing NP phrase annotations (from 
              NPlabels);
              Returns list of sentence tokens in the phrase, and 
              indices of the phrase;
          ''' 
          phrase  = []
          indices = []
          if 0 <= i and i < len(sentence) and NPlabels[i] == 'B':
              phrase  = [ sentence[i] ]
              indices = [ i ]
              j = i + 1
              while ( j < len(sentence) ):
                  if NPlabels[j] in ['B', '']:
                      break
                  else:
                      phrase.append( sentence[j] )
                      indices.append( j )
                  j += 1
          return phrase, indices
docs: Fetches the full length phrase from the position i
              based on the existing NP phrase annotations (from 
              NPlabels);
              Returns list of sentence tokens in the phrase, and 
              indices of the phrase;