예제 #1
0
def post_hagahot(ja_hg):
    replace_dict = {u"@11\([\u05d0-\u05ea]{1,3}\)\s?@33": u"",
                    u"@77": u"", u"@44": u"<br>", u"@55": u"<b>", u"@66": u"</b>", u"@00(.+?)\s(.+)": u"",
                    u"@(?:99|01)(.*?)@": ur"<br><small>\1</small><br>"}
    ja_hg = before_post_cleaner(ja_hg, replace_dict)

    text_version = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource': 'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': ja_hg
    }
    schema = JaggedArrayNode()
    schema.add_title('Haggahot Chadashot on Sefer Mitzvot Katan', 'en', True)
    schema.add_title(u'הגהות חדשות על ספר מצוות קטן', 'he', True)
    schema.key = 'Haggahot Chadashot on Sefer Mitzvot Katan'
    schema.depth = 2
    schema.addressTypes = ['Integer', 'Integer']
    schema.sectionNames = ['Siman', 'Segment']
    schema.validate()

    add_term('Haggahot Chadashot on Sefer Mitzvot Katan',u'הגהות חדשות על ספר מצוות קטן')
    index_dict = {
        'title': 'Haggahot Chadashot on Sefer Mitzvot Katan',
        'dependence': "Commentary",
        'base_text_titles': ["Sefer Mitzvot Katan", 'Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan'],
        "categories": ["Halakhah", "Commentary"],
        'schema': schema.serialize(),  # This line converts the schema into json
        'collective_title': 'Haggahot Chadashot on Sefer Mitzvot Katan',
    }
    post_index(index_dict)

    post_text('Haggahot Chadashot on Sefer Mitzvot Katan', text_version)
예제 #2
0
def post_raph(ja_raph):
    replace_dict = {u"@22": u"<br>"}
    ja_raph = inlinereferencehtml(ja_raph)
    ja_raph = before_post_cleaner(ja_raph, replace_dict)
    text_version = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource':
        'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': ja_raph
    }

    schema = JaggedArrayNode()
    schema.add_title('Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan', 'en',
                     True)
    schema.add_title(u'הגהות רבנו פרץ על ספר מצוות קטן', 'he', True)
    schema.key = 'Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan'
    schema.depth = 2
    schema.addressTypes = ['Integer', 'Integer']
    schema.sectionNames = ['Siman', 'Segment']
    schema.validate()
    add_term('Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan',
             u'הגהות רבנו פרץ על ספר מצוות קטן')
    index_dict = {
        'title': 'Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan',
        'dependence': "Commentary",
        'base_text_titles': ["Sefer Mitzvot Katan"],
        "categories": ["Halakhah", "Commentary"],
        'schema':
        schema.serialize(),  # This line converts the schema into json
        'collective_title': 'Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan',
    }
    post_index(index_dict)

    post_text('Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan', text_version)
예제 #3
0
def post_raph(ja_raph):
    replace_dict = {u"@22": u"<br>"}
    ja_raph = inlinereferencehtml(ja_raph)
    ja_raph = before_post_cleaner(ja_raph, replace_dict)
    text_version = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource': 'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': ja_raph
    }

    schema = JaggedArrayNode()
    schema.add_title('Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan', 'en', True)
    schema.add_title(u'הגהות רבנו פרץ על ספר מצוות קטן', 'he', True)
    schema.key = 'Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan'
    schema.depth = 2
    schema.addressTypes = ['Integer', 'Integer']
    schema.sectionNames = ['Siman', 'Segment']
    schema.validate()
    add_term('Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan', u'הגהות רבנו פרץ על ספר מצוות קטן')
    index_dict = {
        'title': 'Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan',
        'dependence': "Commentary",
        'base_text_titles': ["Sefer Mitzvot Katan"],
        "categories": ["Halakhah", "Commentary"],
        'schema': schema.serialize(),# This line converts the schema into json
        'collective_title': 'Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan',
    }
    post_index(index_dict)

    post_text('Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan', text_version)
예제 #4
0
def add_remazim_node():
    add_term(u"Remazim", u"רמזים")

    smk_remazim = JaggedArrayNode()
    smk_remazim.add_title(
        u'Remazim',
        'en',
        primary=True,
    )
    smk_remazim.add_title(
        u'רמזים',
        'he',
        primary=True,
    )
    smk_remazim.key = u'Remazim'
    smk_remazim.depth = 1
    smk_remazim.sectionNames = ['Paragraph']
    smk_remazim.addressTypes = ['Integer']

    # library.get_schema_node("Sefer Mitzvot Katan")
    smk_schema = Ref("Sefer Mitzvot Katan").index_node
    attach_branch(smk_remazim, smk_schema, place=1)
    text_version_remazim = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource':
        'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': [u"א", u"ב"]
    }
예제 #5
0
def add_terms_locally(comment_store):
    """
    :param CommentStore comment_store:
    :return:
    """
    for en_name, he_name in comment_store.commentator_mapping.items():
        if not Term().load_by_title(en_name):
            add_term(en_name, he_name, server='http://localhost:8000')
예제 #6
0
def add_terms_locally(comment_store):
    """
    :param CommentStore comment_store:
    :return:
    """
    for en_name, he_name in comment_store.commentator_mapping.items():
        if not Term().load_by_title(en_name):
            add_term(en_name, he_name, server='http://localhost:8000')
def term_check(term):
    t = Term().load_by_title(term)
    if not t:
        if type(term) == dict:
            add_term(term['en'], term['he'], server=SEFARIA_SERVER)
        else:
            print u"Please privide a term dict {'en': <english term spelling>, 'he': <hebrew term spelling>} as the collective_title_term"
            return False
    return t
예제 #8
0
def post_hagahot(ja_hg):
    replace_dict = {
        u"@11\([\u05d0-\u05ea]{1,3}\)\s?@33": u"",
        u"@77": u"",
        u"@44": u"<br>",
        u"@55": u"<b>",
        u"@66": u"</b>",
        u"@00(.+?)\s(.+)": u"",
        u"@(?:99|01)(.*?)@": ur"<br><small>\1</small><br>"
    }
    ja_hg = before_post_cleaner(ja_hg, replace_dict)

    text_version = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource':
        'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': ja_hg
    }
    schema = JaggedArrayNode()
    schema.add_title('Haggahot Chadashot on Sefer Mitzvot Katan', 'en', True)
    schema.add_title(u'הגהות חדשות על ספר מצוות קטן', 'he', True)
    schema.key = 'Haggahot Chadashot on Sefer Mitzvot Katan'
    schema.depth = 2
    schema.addressTypes = ['Integer', 'Integer']
    schema.sectionNames = ['Siman', 'Segment']
    schema.validate()

    add_term('Haggahot Chadashot on Sefer Mitzvot Katan',
             u'הגהות חדשות על ספר מצוות קטן')
    index_dict = {
        'title':
        'Haggahot Chadashot on Sefer Mitzvot Katan',
        'dependence':
        "Commentary",
        'base_text_titles': [
            "Sefer Mitzvot Katan",
            'Haggahot Rabbeinu Peretz on Sefer Mitzvot Katan'
        ],
        "categories": ["Halakhah", "Commentary"],
        'schema':
        schema.serialize(),  # This line converts the schema into json
        'collective_title':
        'Haggahot Chadashot on Sefer Mitzvot Katan',
    }
    post_index(index_dict)

    post_text('Haggahot Chadashot on Sefer Mitzvot Katan', text_version)
예제 #9
0
def add_remazim_node():
    add_term(u"Remazim", u"רמזים")

    smk_remazim = JaggedArrayNode()
    smk_remazim.add_title(u'Remazim', 'en', primary=True, )
    smk_remazim.add_title(u'רמזים', 'he', primary=True, )
    smk_remazim.key = u'Remazim'
    smk_remazim.depth = 1
    smk_remazim.sectionNames = ['Paragraph']
    smk_remazim.addressTypes = ['Integer']

    # library.get_schema_node("Sefer Mitzvot Katan")
    smk_schema = Ref("Sefer Mitzvot Katan").index_node
    attach_branch(smk_remazim, smk_schema, place=1)
    text_version_remazim = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource': 'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': [u"א", u"ב"]
    }
예제 #10
0
def post_smk(ja_smk):
    replace_dict = {u"@23(.*)": ur"<small>\1</small>", u"@(?:99|04)(.*?)\n": ur"<small>\1</small>", u"@0(?:1|2|3)(.*)":ur"<b>\1</b>"}
    ja_smk = inlinereferencehtml(ja_smk)
    ja_smk = before_post_cleaner(ja_smk, replace_dict)

    text_version_smk = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource': 'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': ja_smk
    }


    text_version_intro = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource': 'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': [u"הקדמה"]
    }

    text_version_remazim = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource': 'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': [u"א", u"ב"]
    }

    smk_root = SchemaNode()
    smk_root.add_title(u'Sefer Mitzvot Katan', 'en', True)
    smk_root.add_title(u'ספר מצוות קטן', 'he', True)
    smk_root.key = u'Sefer Mitzvot Katan'


    # index record for the introduction
    smk_intro = JaggedArrayNode()
    smk_intro.add_title(u'Introduction', 'en', primary=True, )
    smk_intro.add_title(u'הקדמה', 'he', primary=True, )
    smk_intro.key = u'Introduction'
    smk_intro.depth = 1
    smk_intro.sectionNames = ['Paragraph']
    smk_intro.addressTypes = ['Integer']

    smk_root.append(smk_intro)

    add_term(u"Remazim", u"רמזים")
    smk_remazim = JaggedArrayNode()
    smk_remazim.add_title(u'Remazim', 'en', primary=True, )
    smk_remazim.add_title(u'רמזים', 'he', primary=True, )
    smk_remazim.key = u'Remazim'
    smk_remazim.depth = 1
    smk_remazim.sectionNames = ['Paragraph']
    smk_remazim.addressTypes = ['Integer']
    smk_root.append(smk_remazim)

    smk_schema = JaggedArrayNode()
    smk_schema.key = u"default"
    smk_schema.default = True
    smk_schema.depth = 2
    smk_schema.addressTypes = ['Integer', 'Integer']
    smk_schema.sectionNames = ['Siman', 'Segment']


    smk_root.append(smk_schema)
    smk_root.validate()

    days = [['First Day',u'1-36', u'יום ראשון: מצות התלויות בלב'], ['Second Day',u'37-101', u'יום שני: מצות התלויות בגוף'], ['Third Day',u'102-151', u'יום שלישי: מצות התלויות בלשון'],
            ['Fourth Day',u'152-196', u'יום רביעי: מצות התלויות בידים'], ['Fifth Day',u'197-238', u'יום חמישי: מצות התלויות באכילה'], ['Sixth Day', u'239-279', u'יום ששי: מצות התלויות בממון'],
            ['Seventh Day',u'280-294', u'יום שביעי: מצות של שבת']]
    nodes = []
    for day in days:
        node = ArrayMapNode()
        node.depth = 0
        node.wholeRef = "Sefer Mitzvot Katan {}".format(day[1])
        # node.refs = "Sefer Mitzvot Katan {}".format(day[1])
        node.includeSections = True
        node.add_primary_titles(day[0], day[2])
        nodes.append(node.serialize())

    add_term("Pillars", u"עמודים")

    index_dict = {
        'title': 'Sefer Mitzvot Katan',
        'categories': ['Halakhah'],
        'alt_structs': {"Pillars": {"nodes": nodes}},
        # "author": [u'Isaac ben Joseph of Corbeil'],
        'schema': smk_root.serialize(),  # This line converts the schema into json

    }



    # add_category('Sefer Mitzvot Katan', ['Halakhah'], u'ספר מצוות קטן')
    post_index(index_dict)

    post_text(u'Sefer Mitzvot Katan', text_version_smk)
예제 #11
0
 'Mishneh_Torah,_Tithes',
 'Mishneh_Torah,_First_Fruits_and_other_Gifts_to_Priests_Outside_the_Sanctuary',
 'Mishneh_Torah,_Foreign_Worship_and_Customs_of_the_Nations',
 'Mishneh_Torah,_Vessels_of_the_Sanctuary_and_Those_who_Serve_Therein',
 'Mishneh_Torah,_Things_Forbidden_on_the_Altar',
 'Mishneh_Torah,_Daily_Offerings_and_Additional_Offerings',
 'Mishneh_Torah,_Defilement_of_Foods',
 'Mishneh_Torah,_Murderer_and_the_Preservation_of_Life',
 'Mishneh_Torah,_Ownerless_Property_and_Gifts']

mapping = dict(zip(hebrew_titles, english_titles))

# Make a term
# Maaseh Rokeah
# מעשה רוקח
add_term("Maaseh Rokeach", u"מעשה רקח", "commentary_works")

# Make categories
http_request(SEFARIA_SERVER + "/api/category", body={'apikey': API_KEY}, json_payload={"path":["Halakhah","Mishneh Torah","Commentary","Maaseh Rokeach"], "sharedTitle": "Maaseh Rokeach"}, method="POST")
for sefer in sefarim:

    t = Term().load({"titles.text": sefer})
    if not isinstance(t, Term):
        print u"ARGGG! {}".format(sefer)

    http_request(SEFARIA_SERVER + "/api/category", body={'apikey': API_KEY},
                 json_payload={"path": ["Halakhah", "Mishneh Torah", "Commentary", "Maaseh Rokeach", t.get_primary_title("en")],
                               "sharedTitle": t.get_primary_title("en")}, method="POST")


for name, data in processed.iteritems():
예제 #12
0
                                         link['refs'][0])
                link['refs'][1] = re.sub(u'Turei Zahav|Siftei Kohen',
                                         base_text, link['refs'][1])
            print links[0]['refs']

        index = commentary_index(book_name, he_book_name, user_args.title)
        if user_args.title == u'Siftei Kohen':
            shach_clean(book_ja)
        elif user_args.title == u'Turei Zahav':
            clean_taz(book_ja)
        else:
            remove_question_marks(book_ja)

        if user_args.add_term:
            functions.add_term(user_args.title,
                               book_xml.titles['he'],
                               server=user_args.server)
        functions.add_category(user_args.title,
                               index['categories'],
                               server=user_args.server)

    if user_args.verbose:
        print index
    functions.post_index(index, server=user_args.server)

    version = {
        "versionTitle":
        "Ashlei Ravrevei: Shulchan Aruch Yoreh Deah, Lemberg, 1888",
        "versionSource":
        "http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH002097765",
        "language": "he",
예제 #13
0
def post_smk(ja_smk):
    replace_dict = {
        u"@23(.*)": ur"<small>\1</small>",
        u"@(?:99|04)(.*?)\n": ur"<small>\1</small>",
        u"@0(?:1|2|3)(.*)": ur"<b>\1</b>"
    }
    ja_smk = inlinereferencehtml(ja_smk)
    ja_smk = before_post_cleaner(ja_smk, replace_dict)

    text_version_smk = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource':
        'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': ja_smk
    }

    text_version_intro = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource':
        'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': [u"הקדמה"]
    }

    text_version_remazim = {
        'versionTitle': 'Sefer Mitzvot Katan, Kopys, 1820',
        'versionSource':
        'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001771677',
        'language': 'he',
        'text': [u"א", u"ב"]
    }

    smk_root = SchemaNode()
    smk_root.add_title(u'Sefer Mitzvot Katan', 'en', True)
    smk_root.add_title(u'ספר מצוות קטן', 'he', True)
    smk_root.key = u'Sefer Mitzvot Katan'

    # index record for the introduction
    smk_intro = JaggedArrayNode()
    smk_intro.add_title(
        u'Introduction',
        'en',
        primary=True,
    )
    smk_intro.add_title(
        u'הקדמה',
        'he',
        primary=True,
    )
    smk_intro.key = u'Introduction'
    smk_intro.depth = 1
    smk_intro.sectionNames = ['Paragraph']
    smk_intro.addressTypes = ['Integer']

    smk_root.append(smk_intro)

    add_term(u"Remazim", u"רמזים")
    smk_remazim = JaggedArrayNode()
    smk_remazim.add_title(
        u'Remazim',
        'en',
        primary=True,
    )
    smk_remazim.add_title(
        u'רמזים',
        'he',
        primary=True,
    )
    smk_remazim.key = u'Remazim'
    smk_remazim.depth = 1
    smk_remazim.sectionNames = ['Paragraph']
    smk_remazim.addressTypes = ['Integer']
    smk_root.append(smk_remazim)

    smk_schema = JaggedArrayNode()
    smk_schema.key = u"default"
    smk_schema.default = True
    smk_schema.depth = 2
    smk_schema.addressTypes = ['Integer', 'Integer']
    smk_schema.sectionNames = ['Siman', 'Segment']

    smk_root.append(smk_schema)
    smk_root.validate()

    days = [['First Day', u'1-36', u'יום ראשון: מצות התלויות בלב'],
            ['Second Day', u'37-101', u'יום שני: מצות התלויות בגוף'],
            ['Third Day', u'102-151', u'יום שלישי: מצות התלויות בלשון'],
            ['Fourth Day', u'152-196', u'יום רביעי: מצות התלויות בידים'],
            ['Fifth Day', u'197-238', u'יום חמישי: מצות התלויות באכילה'],
            ['Sixth Day', u'239-279', u'יום ששי: מצות התלויות בממון'],
            ['Seventh Day', u'280-294', u'יום שביעי: מצות של שבת']]
    nodes = []
    for day in days:
        node = ArrayMapNode()
        node.depth = 0
        node.wholeRef = "Sefer Mitzvot Katan {}".format(day[1])
        # node.refs = "Sefer Mitzvot Katan {}".format(day[1])
        node.includeSections = True
        node.add_primary_titles(day[0], day[2])
        nodes.append(node.serialize())

    add_term("Pillars", u"עמודים")

    index_dict = {
        'title': 'Sefer Mitzvot Katan',
        'categories': ['Halakhah'],
        'alt_structs': {
            "Pillars": {
                "nodes": nodes
            }
        },
        # "author": [u'Isaac ben Joseph of Corbeil'],
        'schema':
        smk_root.serialize(),  # This line converts the schema into json
    }

    # add_category('Sefer Mitzvot Katan', ['Halakhah'], u'ספר מצוות קטן')
    post_index(index_dict)

    post_text(u'Sefer Mitzvot Katan', text_version_smk)
예제 #14
0
                }
                links.append(match)

    """
    with open('Unlinked Eliyah Rabbah.txt', 'w') as er_unlinked:
        for index, comment in enumerate(unlinked_comments):
            er_unlinked.write(str(unlinked_indexes[index]))
            er_unlinked.write('\n')
            er_unlinked.write(comment)
            er_unlinked.write('\n')
    """


    server = 'https://eliyah-rabbah.cauldron.sefaria.org'
    erh = 'אליה רבה'
    add_term('Eliyah Rabbah', erh, server = server)
    add_category('Eliyah Rabbah',['Halakhah', 'Shulchan Arukh', 'Commentary', 'Eliyah Rabbah'], server = server)

    english_title = 'Eliyah Rabbah on Shulchan Arukh, Orach Chayim'
    hebrew_title = 'אליה רבה על שלחן ערוך אורח חיים'

    ja = JaggedArrayNode()
    ja.add_primary_titles(english_title, hebrew_title)
    ja.add_structure(['Siman', 'Seif Katan'], address_types=[u'Siman', u'Integer'])
    ja.validate()

    index_dict = {
        'title': english_title,
        'base_text_titles': ['Shulchan Arukh, Orach Chayim'],
        'dependence': 'Commentary',
        'collective_title': 'Eliyah Rabbah',
예제 #15
0
terms, categories = set(), set()
current_commentary, comment_store = None, []
for item in tqdm(iter_cursor(cursor), total=28479):
    if not current_commentary or not current_commentary.is_part_of_commentary(
            item):
        current_commentary = build_commentary_from_row(item)
        comment_store.append(current_commentary)
        terms.add(current_commentary.get_term_data())
        categories.add(current_commentary.get_category())
    current_commentary.add_segments_from_row(item)

server = 'http://localhost:8000'
# server = 'https://www.sefaria.org'
# server = 'http://friedberg.sandbox.sefaria.org'
for term in terms:
    add_term(*term, server=server)

print(f'There are {len(categories)} categories')
# with ThreadPoolExecutor(max_workers=6) as executor:
#     executor.map(print_and_add_category, categories)
for cat in tqdm(categories):
    add_category(cat[-1], list(cat), server=server)

print(f'There are {len(comment_store)} books to upload')
tracker[0] = 0
# with ThreadPoolExecutor(max_workers=3) as executor:
#     executor.map(upload_commentary, comment_store)
# for item, comment in enumerate(tqdm(comment_store), 1):
#     dump_index_and_text(comment)

print(len(terms), *(term[0] for term in terms), sep='\n')
예제 #16
0
    links = []

    if user_args.title is None:  # This is the Shulchan Arukh
        book_name, he_book_name = base_text, he_base_text
        book_ja = root.get_base_text().render()
    else:
        book_name = u'{} on {}'.format(user_args.title, base_text)
        book_xml = root.get_commentaries().get_commentary_by_title(
            user_args.title)
        book_ja = book_xml.render()
        he_book_name = u'{} על {}'.format(book_xml.titles['he'], he_base_text)
        links = book_xml.collect_links()

        if user_args.add_term:
            add_term(user_args.title,
                     book_xml.titles['he'],
                     server=user_args.server)

    index = index_methods.get(book_name,
                              create_simple_index)(en_title=book_name,
                                                   he_title=he_book_name,
                                                   commentator=user_args.title,
                                                   server=user_args.server)
    if user_args.verbose:
        print index

    post_index(index, server=user_args.server)

    if post_parse.get(book_name):
        post_parse[book_name](book_ja)
    version = {
예제 #17
0
        orach_chaim_clean(book_ja)
        add_siman_headers(book_ja)

    else:
        book_name = u"{} on {}".format(user_args.title, base_text_title)
        book_xml = root.get_commentaries().get_commentary_by_title(user_args.title)
        book_ja = book_xml.render()
        he_book_name = u"{} על {}".format(book_xml.titles['he'], he_base_title)
        links = book_xml.collect_links()
        if user_args.title == u"Sha'arei Teshuvah":
            links += shaarei_special_links()
        index = commentary_index(book_name, he_book_name, user_args.title)
        post_parse[user_args.title](book_ja)

        if user_args.add_term:
            functions.add_term(user_args.title, book_xml.titles['he'], server=user_args.server)

        functions.add_category(user_args.title, index['categories'], server=user_args.server)

    if user_args.verbose:
        print index

    functions.post_index(index, server=user_args.server)

    # version = {
    #     "versionTitle": "Maginei Eretz; Shulchan Aruch Orach Chaim, Lemberg, 1893",
    #     "versionTitleInHebrew": u"""ספר מגיני ארץ; שלחן ערוך. למברג, תרנ"ג""",
    #     "versionSource": "http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH002084080",
    #     "language": "he",
    #     "text": book_ja,
    # }
예제 #18
0
    base_text = u'Shulchan Arukh, Choshen Mishpat'
    he_base_text = u'שולחן ערוך חושן משפט'
    links = []

    if user_args.title is None:  # This is the Shulchan Arukh
        book_name, he_book_name = base_text, he_base_text
        book_ja = root.get_base_text().render()
    else:
        book_name = u'{} on {}'.format(user_args.title, base_text)
        book_xml = root.get_commentaries().get_commentary_by_title(user_args.title)
        book_ja = book_xml.render()
        he_book_name = u'{} על {}'.format(book_xml.titles['he'], he_base_text)
        links = book_xml.collect_links()

        if user_args.add_term:
            add_term(user_args.title, book_xml.titles['he'], server=user_args.server)

    index = index_methods.get(book_name, create_simple_index)(en_title=book_name, he_title=he_book_name,
                                         commentator=user_args.title, server=user_args.server)
    if user_args.verbose:
        print index

    post_index(index, server=user_args.server)

    if post_parse.get(book_name):
        post_parse[book_name](book_ja)
    version = {
        'versionTitle': "Shulhan Arukh, Hoshen ha-Mishpat; Lemberg, 1898",
        'versionSource': "http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH002097773",
        'language': 'he',
        'text': book_ja