parameters: (self, constituent, children, head_child)
docstring: add link and label to words after finding heads
docstring_summary: add link and label to words after finding heads
docstring_tokens: add link and label to words after finding heads
function: def add_label(self, constituent, children, head_child):
        """add link and label to words after finding heads"""
        constituent = constituent.split('-')[0]
        for other_child, tmp in children:
           if other_child != head_child:
              assert other_child.link == -1
              other_child.link = head_child.id
              # add label
              sub_cons = tmp.name.split('-')
              if len(sub_cons)>1:
                 # subjects and objects
                 if 'OBJ' in sub_cons[1:]:
                    other_child.label = 'OBJ'
                    continue
                 elif 'SBJ' in sub_cons[1:]:
                    other_child.label = 'SBJ'
                    continue
  #               else:
  #                  print sub_cons[1], head_child.pos
              # any links from inside prepositional phrase
              if constituent == 'PP':
                 if other_child.id > head_child.id:
                    other_child.label = 'POBJ'
                 else:
                    other_child.label = 'PMOD'
              elif constituent in ['NP', 'NN']:
                 other_child.label = 'NMOD'
              elif constituent == 'VP':
                 other_child.label = 'VMOD'
              elif constituent == 'VRD':
                 other_child.label = 'VRD'
              elif constituent == 'IP':
                 if head_child.pos in ['VV', 'VE', 'VC', 'VA']:
                    other_child.label = 'VMOD'
                 else:
                    other_child.label = 'VMOD'
              elif constituent == 'DNP':
                 other_child.label = 'DEG'
              elif constituent == 'DVP':
                 other_child.label = 'DEV'
              elif constituent == 'LCP':
                 other_child.label = 'LC'
              elif constituent in ['QP', 'DP']:
                 if head_child.pos == 'CD':
                    other_child.label = 'NMOD'
                 elif head_child.pos == 'M':
                    other_child.label = 'M'
                 elif head_child.pos == 'OD':
                    other_child.label = 'NMOD'
                 elif head_child.pos == 'NN':
                    other_child.label = 'NMOD'
                 elif head_child.pos == 'DT':
                    other_child.label = 'AMOD'
              elif constituent == 'PRN':
                 other_child.label = 'PRN'
              elif constituent == 'VCP':
                 other_child.label = 'VC'
              elif constituent in ['VCD', 'UCP']:
                 other_child.label = 'COOR'
              else:
                 if head_child.pos in ['VV', 'VC', 'VE', 'VA']:
                    other_child.label = 'VMOD'
                 elif head_child.pos in ['NN', 'NR', 'PN', 'NT']:
                    other_child.label = 'NMOD'
                 elif head_child.pos == 'CS':
                    other_child.label = 'CS'
                 elif head_child.pos == 'AD':
                    other_child.label = 'AMOD'
                 elif head_child.pos == 'JJ':
                    other_child.label = 'AMOD'
                 elif head_child.pos == 'DEC':
                    other_child.label = 'DEC'
                 elif head_child.pos == 'M':
                    other_child.label = 'M'
                 elif head_child.pos == 'CD':
                    other_child.label = 'NMOD'
                 elif head_child.pos == 'OD':
                    other_child.label = 'NMOD'
                 elif head_child.pos == 'DT':
                    other_child.label = 'NMOD'
                 elif head_child.pos == 'PU':
                    other_child.label = 'NMOD'
                 elif head_child.pos == 'P':
                    other_child.label = 'PMOD'
                 elif head_child.pos == 'IJ':
                    other_child.label = 'PMOD'
                 elif head_child.pos == 'LC':
                    other_child.label = 'LC'
              if other_child.label == '':
                 other_child.label = '???'
function_tokens: def add_label ( self , constituent , children , head_child ) : constituent = constituent . split ( '-' ) [ 0 ] for other_child , tmp in children : if other_child != head_child : assert other_child . link == - 1 other_child . link = head_child . id # add label sub_cons = tmp . name . split ( '-' ) if len ( sub_cons ) > 1 : # subjects and objects if 'OBJ' in sub_cons [ 1 : ] : other_child . label = 'OBJ' continue elif 'SBJ' in sub_cons [ 1 : ] : other_child . label = 'SBJ' continue #               else: #                  print sub_cons[1], head_child.pos # any links from inside prepositional phrase if constituent == 'PP' : if other_child . id > head_child . id : other_child . label = 'POBJ' else : other_child . label = 'PMOD' elif constituent in [ 'NP' , 'NN' ] : other_child . label = 'NMOD' elif constituent == 'VP' : other_child . label = 'VMOD' elif constituent == 'VRD' : other_child . label = 'VRD' elif constituent == 'IP' : if head_child . pos in [ 'VV' , 'VE' , 'VC' , 'VA' ] : other_child . label = 'VMOD' else : other_child . label = 'VMOD' elif constituent == 'DNP' : other_child . label = 'DEG' elif constituent == 'DVP' : other_child . label = 'DEV' elif constituent == 'LCP' : other_child . label = 'LC' elif constituent in [ 'QP' , 'DP' ] : if head_child . pos == 'CD' : other_child . label = 'NMOD' elif head_child . pos == 'M' : other_child . label = 'M' elif head_child . pos == 'OD' : other_child . label = 'NMOD' elif head_child . pos == 'NN' : other_child . label = 'NMOD' elif head_child . pos == 'DT' : other_child . label = 'AMOD' elif constituent == 'PRN' : other_child . label = 'PRN' elif constituent == 'VCP' : other_child . label = 'VC' elif constituent in [ 'VCD' , 'UCP' ] : other_child . label = 'COOR' else : if head_child . pos in [ 'VV' , 'VC' , 'VE' , 'VA' ] : other_child . label = 'VMOD' elif head_child . pos in [ 'NN' , 'NR' , 'PN' , 'NT' ] : other_child . label = 'NMOD' elif head_child . pos == 'CS' : other_child . label = 'CS' elif head_child . pos == 'AD' : other_child . label = 'AMOD' elif head_child . pos == 'JJ' : other_child . label = 'AMOD' elif head_child . pos == 'DEC' : other_child . label = 'DEC' elif head_child . pos == 'M' : other_child . label = 'M' elif head_child . pos == 'CD' : other_child . label = 'NMOD' elif head_child . pos == 'OD' : other_child . label = 'NMOD' elif head_child . pos == 'DT' : other_child . label = 'NMOD' elif head_child . pos == 'PU' : other_child . label = 'NMOD' elif head_child . pos == 'P' : other_child . label = 'PMOD' elif head_child . pos == 'IJ' : other_child . label = 'PMOD' elif head_child . pos == 'LC' : other_child . label = 'LC' if other_child . label == '' : other_child . label = '???'