bin.sizeclassifier

Module Contents

bin.sizeclassifier.__author__ = Martin Paul Eve[source]
bin.sizeclassifier.__email__ = martin@martineve.com[source]

A class that scans for meTypeset size fields in a TEI file.

1.) Identifies a list of sizes 2.) Ascertains the density and likelihood of the size being a heading 3.) Returns a manipulator ready to implement all the changes to the TEI file

class bin.sizeclassifier.SizeClassifier(global_variables)[source]

Bases: debug.Debuggable

static get_values(tree, search_attribute)[source]
static get_sizes_ordered(tree)[source]
set_dom_tree(self, filename)[source]
static handle_bold_only_paragraph(manipulate, root_size)[source]

This method looks for paragraphs that contain only bold text. It then transforms them to titles. @param manipulate: a TeiManipulator object @param root_size: the size styling to apply to these elements

static handle_heading(manipulate, attribute, root_size)[source]

This method looks for paragraphs that contain the specified attribute in their rend tag. It then transforms them to titles. @param manipulate: a TeiManipulator object @param attribute: a string to search for in the rend attribute @param root_size: the size styling to apply to these elements

get_sizes(self, tree)[source]
correlate_styled_headings(self, manipulate)[source]
convert_to_headings(self, manipulate, sizes, tree)[source]
encapsulate_headings(self, manipulate, tree)[source]
nest_headings(self, manipulate, tree)[source]
verify_headings(self, stack, tree)[source]
remove_empty_headings(self, manipulate, tree)[source]
downgrade_oversize_headings(self, manipulate, tree)[source]
handle_capital_only_paragraph(self, manipulate, new_size)[source]
handle_single_item_list(self, manipulate, new_size)[source]
clean_introduction_headings(self, manipulate)[source]
clean_line_breaks(self, manipulate)[source]
renest_headings(self, manipulate, tree)[source]
final_headings(self, manipulate, tree)[source]
run(self)[source]