def parse_the_text(file_name_teshuvot, file_name_footnotes, dictionary): teshuvot_ja = function.parse(file_name_teshuvot) footnotes_ja = function.parse(file_name_footnotes) links = function.create_links(teshuvot_ja, dictionary) index_teshuvot = function.create_index(dictionary) index_footnotes = function.create_index(dictionary,footnotes, footnotes_hebrew) teshuvot_ja = util.clean_jagged_array(teshuvot_ja, ['\d+', '\+']) footnotes_ja = util.clean_jagged_array(footnotes_ja, ['\d+', '\+']) text_teshuvot = function.create_text(dictionary, teshuvot_ja) text_footnotes = function.create_text(dictionary, footnotes_ja) functions.post_index(index_teshuvot) functions.post_index(index_footnotes) functions.post_text_weak_connection('Teshuvot haRashba part {}'.format(dictionary['roman numeral']), text_teshuvot) functions.post_text_weak_connection('Footnotes to Teshuvot haRashba part {}'.format(dictionary['roman numeral']), text_footnotes) functions.post_link_weak_connection(links)
def upload_footnotes(full_text, upload=False): """ :param full_text: Data structure from parse_text() :param upload: set to True, otherwise function will do nothing """ if not upload: return # make JSON object of book for ref in full_text.keys(): book = { "versionTitle": "JPS Footnotes", "versionSource": "JPS", "language": "en", "text": full_text[ref] } print ref functions.post_text_weak_connection('JPS 1985 Footnotes, {}'.format(ref), book)
def upload_main_text(things_to_upload, upload=True): """ :param things_to_upload: A dictionary where the keys are the refs, values are the texts :param upload: set this to false and the function will do nothing """ if not upload: return # make JSON object of book for ref in things_to_upload.keys(): book = { "versionTitle": "JPS 1985 English Translation", "versionSource": "Copyright JPS publishing", "language": "en", "text": things_to_upload[ref] } print ref functions.post_text_weak_connection(ref, book)
def upload_footnotes(full_text, upload=False): """ :param full_text: Data structure from parse_text() :param upload: set to True, otherwise function will do nothing """ if not upload: return # make JSON object of book for ref in full_text.keys(): book = { "versionTitle": "JPS Footnotes", "versionSource": "JPS", "language": "en", "text": full_text[ref] } print ref functions.post_text_weak_connection( 'JPS 1985 Footnotes, {}'.format(ref), book)
def parse_the_text(file_name_teshuvot, file_name_footnotes, dictionary): teshuvot_ja = function.parse(file_name_teshuvot) footnotes_ja = function.parse(file_name_footnotes) links = function.create_links(teshuvot_ja, dictionary) index_teshuvot = function.create_index(dictionary) index_footnotes = function.create_index(dictionary, footnotes, footnotes_hebrew) teshuvot_ja = util.clean_jagged_array(teshuvot_ja, ['\d+', '\+']) footnotes_ja = util.clean_jagged_array(footnotes_ja, ['\d+', '\+']) text_teshuvot = function.create_text(dictionary, teshuvot_ja) text_footnotes = function.create_text(dictionary, footnotes_ja) functions.post_index(index_teshuvot) functions.post_index(index_footnotes) functions.post_text_weak_connection( 'Teshuvot haRashba part {}'.format(dictionary['roman numeral']), text_teshuvot) functions.post_text_weak_connection( 'Footnotes to Teshuvot haRashba part {}'.format( dictionary['roman numeral']), text_footnotes) functions.post_link_weak_connection(links)