colrev.env.tei_parser.TEIParser
- class colrev.env.tei_parser.TEIParser(*, pdf_path=None, tei_path=None, consolidate_header=False, consolidate_citations=False)[source]
Bases:
objectColRev-facing TEI API backed by
grobid_tei.Create TEI from a PDF or read an existing TEI file.
If both paths are supplied and
tei_pathalready exists, it is read without contacting GROBID, as in the previous ColRev implementation. Consolidation flags apply when a PDF is submitted to GROBID.Methods
get_abstractGet the abstract, using the legacy empty-string value when absent.
get_author_detailsReturn author details in grobid-tei's native dictionary format.
get_citations_per_sectionGet section names mapped to their cited TEI IDs.
get_grobid_versionGet the GROBID version recorded in the TEI, or an empty string.
get_metadataReturn GROBID metadata using CoLRev's record field names.
get_paper_keywordsGet document keywords.
get_referencesReturn references as ColRev record dictionaries.
get_tei_strReturn the TEI document as a Unicode string.
iter_paragraphsIterate over document paragraphs using grobid_tei's extraction.
mark_referencesMatch references using ColRev and annotate the corresponding TEI IDs.
- get_abstract()[source]
Get the abstract, using the legacy empty-string value when absent.
- Return type:
str
- get_author_details()[source]
Return author details in grobid-tei’s native dictionary format.
- Return type:
list
- get_citations_per_section()[source]
Get section names mapped to their cited TEI IDs.
- Return type:
dict
- get_grobid_version()[source]
Get the GROBID version recorded in the TEI, or an empty string.
- Return type:
str
- get_metadata()[source]
Return GROBID metadata using CoLRev’s record field names.
Bibliographic values come from grobid_tei’s public metadata API.
- Return type:
dict
- get_references(*, add_intext_citation_count=False)[source]
Return references as ColRev record dictionaries.
- Return type:
list