def corpus(path, encoding='utf-8'):
 for s in open(path, encoding=encoding):
  s = map((lambda w: w.split('/')), s.strip().split(' '))
  s = map((lambda w: (w[0].replace('&slash;', '/'), w[1])), s)
  (yield s)

def corpus ( path , encoding = 'utf-8' ) : for s in open ( path , encoding = encoding ) : s = map ( ( lambda w : w . split ( '/' ) ) , s . strip ( ) . split ( ' ' ) ) s = map ( ( lambda w : ( w [ 0 ] . replace ( '&slash;' , '/' ) , w [ 1 ] ) ) , s ) ( yield s )
yields sentences of -tuples from the given corpus .