doc2json/tex2json/xml_to_json.py
def process_bibentry(bib_text: str, grobid_client: GrobidClient, logfile: str):
    """
    Process one bib entry text into title, authors, etc
    :param bib_text:
    :param grobid_client:
    :param logfile:
    :return:
    """
    if not bib_text:
        return None
    bib_lines = bib_text.split('\n')
    bib_lines = [re.sub(r'\s+', ' ', line) for line in bib_lines]
    bib_lines = [re.sub(r'\s', ' ', line).strip() for line in bib_lines]
    bib_string = ' '.join(bib_lines)
    xml_str = grobid_client.process_citation(bib_string, logfile)
    if xml_str:
        soup = BeautifulSoup(xml_str, 'lxml')
        bib_entry = parse_bib_entry(soup)
        if not bib_entry['raw_text']:
            bib_entry['raw_text'] = bib_string
        return bib_entry
    return None

    Process one bib entry text into title, authors, etc
    :param bib_text:
    :param grobid_client:
    :param logfile:
    :return:
    
Process one bib entry text into title, authors, etc
Process one bib entry text into title authors etc
def process_bibentry(bib_text: str, grobid_client: GrobidClient, logfile: str):
    if not bib_text:
        return None
    bib_lines = bib_text.split('\n')
    bib_lines = [re.sub(r'\s+', ' ', line) for line in bib_lines]
    bib_lines = [re.sub(r'\s', ' ', line).strip() for line in bib_lines]
    bib_string = ' '.join(bib_lines)
    xml_str = grobid_client.process_citation(bib_string, logfile)
    if xml_str:
        soup = BeautifulSoup(xml_str, 'lxml')
        bib_entry = parse_bib_entry(soup)
        if not bib_entry['raw_text']:
            bib_entry['raw_text'] = bib_string
        return bib_entry
    return None
def process_bibentry ( bib_text : str , grobid_client : GrobidClient , logfile : str ) : if not bib_text : return None bib_lines = bib_text . split ( '\n' ) bib_lines = [ re . sub ( r'\s+' , ' ' , line ) for line in bib_lines ] bib_lines = [ re . sub ( r'\s' , ' ' , line ) . strip ( ) for line in bib_lines ] bib_string = ' ' . join ( bib_lines ) xml_str = grobid_client . process_citation ( bib_string , logfile ) if xml_str : soup = BeautifulSoup ( xml_str , 'lxml' ) bib_entry = parse_bib_entry ( soup ) if not bib_entry [ 'raw_text' ] : bib_entry [ 'raw_text' ] = bib_string return bib_entry return None
Process one bib entry text into title, authors, etc
Process one bib entry text into title authors etc
"""
    Process one bib entry text into title, authors, etc
    :param bib_text:
    :param grobid_client:
    :param logfile:
    :return:
    """
None
bib_text
str
None
grobid_client
GrobidClient
None
logfile
str
None