<jupyter_start><jupyter_text>Compose the plain text of Athenaeus Deipnosophistae from the TF source<jupyter_code>import os
from tf.app import use
# A = use('athenaeus', hoist=globals())
A = use("athenaeus:clone", checkout="clone", hoist=globals())
def wrap(text, size=100):
    words = text.split(" ")
    result = ""
    sep = ""
    cur = 0
    for word in words:
        if cur and cur + len(word) > size:
            result += "\n"
            sep = ""
            cur = 0
        add = sep + word
        result += add
        cur += len(add)
        sep = " "
    return result
with open(os.path.expanduser("~/Downloads/athenaeus.txt"), "w") as fh:
    for b in F.otype.s("book"):
        fh.write(f"""\n{T.sectionFromNode(b)[0]}\n\n""")
        for c in L.d(b, otype="chapter"):
            fh.write(f"""\n{'.'.join(str(i) for i in T.sectionFromNode(c))}\n\n""")
            for s in L.d(c, otype="_sentence"):
                fh.write(f"""{wrap(T.text(s), 100)}\n""")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1791044776119403, 'fraction_numerical': 0.008955223880597015, 'mean_word_length': 2.421768707482993, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '449690', 'license': 'Unlicense', 'n_tokens_mistral': 380, 'n_tokens_neox': 365, 'n_words': 84, 'path': 'tutorials/cookbook/plaintext.ipynb', 'repo_name': 'pthu/athenaeus', 'size': '1005'}