<jupyter_start><jupyter_text>Use Text-FabricText-Fabric is a rich API.It might pay off to look at tutorials for[various different corpora in TF](https://annotation.github.io/text-fabric/tf/about/corpora.html).<jupyter_code>from tf.app import use
A = use("among/fusus/tf/Lakhnawi:clone", version="0.4", writing="ara", hoist=globals())
F.otype.all
F.otype.maxSlot<jupyter_output><empty_output><jupyter_text>Show the pieces<jupyter_code>results = A.search("""
piece n* np* title*
""")
A.show(results)
results<jupyter_output><empty_output><jupyter_text>All words on the first line of every page<jupyter_code>template = """
line ln=1
  word
"""
results = A.search(template)
results[0:10]
A.table(results, end=20)<jupyter_output><empty_output><jupyter_text>All first words of the first line of every page<jupyter_code>template = """
line ln=1
  =: word
"""
results = A.search(template)
A.table(results, end=20)<jupyter_output>0.05s 438 results<jupyter_text>All last words of the first line of every page<jupyter_code>template = """
line ln=1
  := word
"""
results = A.search(template)
A.table(results, end=20)<jupyter_output>0.05s 438 results<jupyter_text>All first words of a piece<jupyter_code>template = """
piece
  =: word
"""
results = A.search(template)
A.table(results, end=20)
ln = A.nodeFromSectionStr("4 14:1")
A.plain(ln)<jupyter_output><empty_output><jupyter_text>Pick line 500<jupyter_code>l = F.otype.s("line")[499]
l<jupyter_output><empty_output><jupyter_text>Where is it?<jupyter_code>A.plain(l)<jupyter_output><empty_output><jupyter_text>Show structure<jupyter_code>A.pretty(l)<jupyter_output><empty_output><jupyter_text>Show more info<jupyter_code>A.pretty(l, extraFeatures="n")<jupyter_output><empty_output><jupyter_text>Locate a specific portion<jupyter_code>template = """
piece n=5
  =: page
    line
      word text~ا
"""
results = A.search(template)
A.show(results, condensed=True)
A.show(results, condensed=True, extraFeatures="n title")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14501510574018128, 'fraction_numerical': 0.019637462235649546, 'mean_word_length': 7.831111111111111, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '128194', 'license': 'MIT', 'n_tokens_mistral': 798, 'n_tokens_neox': 757, 'n_words': 131, 'path': 'notebooks/useTf.ipynb', 'repo_name': 'lwcvl/fusus', 'size': '1986'}