Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. def with_paragraf(data):
  2.     table = []
  3.     for p in data:
  4.         paragraf = []
  5.         for sentence in p:
  6.             sentence_string = ''
  7.             for word in sentence:
  8.                 if word[0].tail is not None:
  9.                     merge = word[0].tail + word.tail.replace('\n', '')
  10.                     print(merge)
  11.                     sentence_string += merge + ' '
  12.             paragraf.append(sentence_string)
  13.         table.append(paragraf)
  14.     return table
  15.  
  16. def with_no_paragraf(data):
  17.     table = []
  18.     for sentence in data:
  19.         sentence_string = ''
  20.         for word in sentence:
  21.             if word[0].tail is not None:
  22.                 merge = word[0].tail + word.tail.replace('\n', '')
  23.                 sentence_string += merge + ' '
  24.         table.append(sentence_string)
  25.     return table
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement