You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

16 lines
400 B

  1. def split_fragments(text):
  2. res = list()
  3. for fragment in contents.split():
  4. if "’" in fragment:
  5. (before, after) = fragment.split("’")
  6. res.append(before)
  7. res.append(after)
  8. else:
  9. res.append(fragment)
  10. return res
  11. contents = "L’univers est, peut-être, « infini! »"
  12. fragments = split_fragments(contents)
  13. print(fragments)