def _normalize_tags(chunk):
 ret = []
 for (word, tag) in chunk:
  if ((tag == u'NP-TL') or (tag == u'NP')):
   ret.append((word, u'NNP'))
   continue
  if tag.endswith(u'-TL'):
   ret.append((word, tag[:(-3)]))
   continue
  if tag.endswith(u'S'):
   ret.append((word, tag[:(-1)]))
   continue
  ret.append((word, tag))
 return ret

def _normalize_tags ( chunk ) : ret = [ ] for ( word , tag ) in chunk : if ( ( tag == u'NP-TL' ) or ( tag == u'NP' ) ) : ret . append ( ( word , u'NNP' ) ) continue if tag . endswith ( u'-TL' ) : ret . append ( ( word , tag [ : ( - 3 ) ] ) ) continue if tag . endswith ( u'S' ) : ret . append ( ( word , tag [ : ( - 1 ) ] ) ) continue ret . append ( ( word , tag ) ) return ret
normalize the corpus tags .