doc2json/tex2json/xml_to_json.py
def process_sections_from_text(sp: BeautifulSoup) -> Dict:
    """
    Generate section dict and replace with id tokens
    :param sp:
    :return:
    """
    # initialize
    section_map = dict()
    max_above_1000 = 999

    for div0 in sp.find_all('div0'):
        parent = None
        section_map.update(get_sections_from_div(div0, sp, parent, max_above_1000 + 1))
        # add any unspecified keys
        sec_keys = [int(k.strip('SECREF')) for k in section_map.keys() if k and k.strip('SECREF').isdigit()]
        max_above_1000 = max(sec_keys + [max_above_1000]) + 1

    return section_map

    Generate section dict and replace with id tokens
    :param sp:
    :return:
    
Generate section dict and replace with id tokens
Generate section dict and replace with id tokens
def process_sections_from_text(sp: BeautifulSoup) -> Dict:
    section_map = dict()
    max_above_1000 = 999
    for div0 in sp.find_all('div0'):
        parent = None
        section_map.update(get_sections_from_div(div0, sp, parent, max_above_1000 + 1))
        sec_keys = [int(k.strip('SECREF')) for k in section_map.keys() if k and k.strip('SECREF').isdigit()]
        max_above_1000 = max(sec_keys + [max_above_1000]) + 1
    return section_map
def process_sections_from_text ( sp : BeautifulSoup ) -> Dict : section_map = dict ( ) max_above_1000 = 999 for div0 in sp . find_all ( 'div0' ) : parent = None section_map . update ( get_sections_from_div ( div0 , sp , parent , max_above_1000 + 1 ) ) sec_keys = [ int ( k . strip ( 'SECREF' ) ) for k in section_map . keys ( ) if k and k . strip ( 'SECREF' ) . isdigit ( ) ] max_above_1000 = max ( sec_keys + [ max_above_1000 ] ) + 1 return section_map
Generate section dict and replace with id tokens
Generate section dict and replace with id tokens
"""
    Generate section dict and replace with id tokens
    :param sp:
    :return:
    """ # initialize # add any unspecified keys
None
sp
BeautifulSoup
None