Updated notebooks for new library organisation
[cipher-tools.git] / support / text_prettify.py
index d3a6ffa6e008f8ab72c8764a5b33d03bb00b81a0..751df38aeb661bd9aab907219a1545d53936e676 100644 (file)
@@ -1,6 +1,12 @@
-from segment import segment
-from utilities import cat, sanitise
 import string
+from support.segment import segment
+from support.utilities import cat, lcat, sanitise
+
+
+def prettify(text, width=100):
+    """Segment a text into words, then pack into lines, and combine the lines
+    into a single string for printing."""
+    return lcat(tpack(segment(text), width=width))
 
 
 def tpack(text, width=100):