Open
Description
tmw-functions will be merged with the cophi-toolbox that contains functions from other projects.
For documentation purposes please expand docstrings by author and email.
If necessary enhance the function's description as well.
Conventions:
At the beginning of each file:
author = "" <-- project/s
authors = "" <-- name of the developer/s
email = "" <-- email of the developer
version = "0.3.0"
date = "2016-03-20"
For each function:
def example_function (args):
""
description ....
Args: ....
ToDo: .....
Author: ...
""
Example:
def read_tei5(teiPath, txtFolder, xpath):
"""
Extract selected text from TEI P5 files and write TXT files.
Args:
teiPath (str): Path / glob pattern of the TEI files to process.
txtFolder (str): Path to a folder where to write the text files. Will
be created if it doesn't exist yet.
xpath (str): From what should the text be extracted?
``alltext``
all text nodes, including header
``bodytext``
text nodes from the body only
``seg``
Only text that is included in ``seg`` elements
``said``
Only text that is included in ``said`` elements
Todo:
* do we need :func:`lxml.etree.strip_tags` at all? If so, make configurable & sanitize with `xpath`
option
* the :func:`lxml.etree.strip_elements` stuff should be made configurable
* filename munging should use os.path etc.
* code cleanup
* logging instead of print()
Author:
CLiGS
"""
Metadata
Metadata
Assignees
Labels
No labels