def filter_insignificant(chunk, tag_suffixes=('DT', 'CC', 'PRP$', 'PRP')):
 good = []
 for (word, tag) in chunk:
  ok = True
  for suffix in tag_suffixes:
   if tag.endswith(suffix):
    ok = False
    break
  if ok:
   good.append((word, tag))
 return good

def filter_insignificant ( chunk , tag_suffixes = ( 'DT' , 'CC' , 'PRP$' , 'PRP' ) ) : good = [ ] for ( word , tag ) in chunk : ok = True for suffix in tag_suffixes : if tag . endswith ( suffix ) : ok = False break if ok : good . append ( ( word , tag ) ) return good
filter out insignificant tuples from a chunk of text .