INNER CODE UNIT · Python
check_file_consistency
grobidOrg/grobid · grobid-trainer/scripts/check_note_consistency.py:66
def check_file_consistency(xml_file_path, verbose=False):
"""
Check a single TEI file for internal consistency issues.
Returns list of inconsistencies found.
"""
headnotes, footnotes = extract_note_content(xml_file_path)
inconsistencies = []
# Find content that appears in both headnotes and footnotes
common_content = set(headnotes.keys()) & set(footnotes.keys())
for content in common_content:
# Only consider meaningful content (not just line breaks or very short content)
if len(content) > 5 and not content == "<lb/>":
inconsistency = {
'content': content,
'headnote_lines': headnotes[content],
'footnote_lines': footnotes[content],