bin.nlmmanipulate

Module Contents

bin.nlmmanipulate.__author__ = Martin Paul Eve[source]
bin.nlmmanipulate.__email__ = martin@martineve.com[source]
class bin.nlmmanipulate.NlmManipulate(gv)[source]

Bases: manipulate.Manipulate

remove_reference_numbering(self)[source]
remove_empty_elements(self, element)[source]
double_p_compliance(self)[source]
static handle_nested_elements(iter_node, move_node, node, node_parent, outer_node, tag_name, tail_stack, tail_stack_objects)[source]
static search_and_copy(last_node, move_node, nested_sibling, new_element, node, node_parent)[source]
process_node_for_tags(self, nested_sibling, node, search_xpath, tag_name, new_tag='SAME')[source]
static add_error_tag(node, error_number)[source]
close_and_open_tag_not_styled(self, search_xpath, tag_name)[source]

Opens and closes an XML tag within a document. This is primarily useful when we have a marker such as meTypeset:br in comments which corresponds to no JATS/NLM equivalent. We use this function in certain behavioural modes to close the preceding paragraph and open the next.

This variant only performs this action when the subsequent text does not look like a heading.

@param search_xpath: the node that serves as a marker @param tag_name: the tag name that will be open and closed

close_and_open_tag(self, search_xpath, tag_name)[source]

Opens and closes an XML tag within a document. This is primarily useful when we have a marker such as meTypeset:br in comments which corresponds to no JATS/NLM equivalent. We use this function in certain behavioural modes to close the preceding paragraph and open the next.

@param search_xpath: the node that serves as a marker @param tag_name: the tag name that will be open and closed

save_tree(self, tree)[source]
find_text(self, paragraph, text)[source]
insert_break(self, search_xpath, tag_name)[source]

Opens and closes an XML tag within a document. This is primarily useful when we have a marker such as meTypeset:br in comments which corresponds to no JATS/NLM equivalent. We use this function in certain behavioural modes to close the preceding paragraph and open the next.

@param search_xpath: the node that serves as a marker @param tag_name: the tag name that will be open and closed

reflist_indent_method(self, tree)[source]
reflist_year_match_method(self, tree, root, tolerance)[source]
find_or_create_element(self, tree, element_tag, add_xpath, is_sibling)[source]
delete_special_lines(self)[source]
clean_refs(self)[source]
final_clean(self)[source]
find_reference_list(self)[source]
handle_stranded_reference_titles_from_cues(self)[source]
fuse_references(self)[source]
tag_bibliography_refs(self)[source]