def create_onshim_node():
    onshim = SchemaNode()
    onshim.add_title('Laws of the Courts', 'en', primary=True)
    onshim.add_title(u'מנין העונשין', 'he', primary=True)
    onshim.key = 'Laws of the Courts'
    onshim.append(create_intro_nodes())
    onshim.append(create_default_nodes())
    return onshim
def create_miluim_node():
    miluim_node = SchemaNode()
    miluim_node.add_title('Appendix', "en", primary=True)
    miluim_node.add_title(u'מלואים', "he", primary=True)
    miluim_node.key = 'Appendix'
    miluim_node.append(create_intro_nodes())
    miluim_node.append(create_default_nodes())
    return miluim_node
def create_schema():
    eben_ezra = SchemaNode()
    eben_ezra.add_title('Eben Ezra on Lamentations', 'en', primary=True)
    eben_ezra.add_title(u'אבן עזרא על איכה', 'he', primary=True)
    eben_ezra.key = 'Eben Ezra on Lamentations'
    eben_ezra.append(create_intro_node())
    eben_ezra.append(create_commentary_node())
    return eben_ezra
Beispiel #4
0
def create_laws_of_the_court_node():
    law_of_court = SchemaNode()
    law_of_court.add_title("Laws of the Courts", "en", primary=True)
    law_of_court.add_title(u"עונשים", "he", primary=True)
    law_of_court.key = "Laws of the Courts"
    law_of_court.append(create_intro_nodes())
    law_of_court.append(create_default_nodes())
    return law_of_court
Beispiel #5
0
def create_negative_node():
    negative_node = SchemaNode()
    negative_node.add_title("Negative Commandments", "en", primary=True)
    negative_node.add_title(u"מצות לא תעשה", "he", primary=True)
    negative_node.key = "Negative Commandments"
    negative_node.append(create_intro_nodes())
    negative_node.append(create_default_nodes())
    return negative_node
def create_schema():
    ralbag_on_ruth = SchemaNode()
    ralbag_on_ruth.add_title('Ralbag Ruth', 'en', primary=True)
    ralbag_on_ruth.add_title(u'רלב"ג רות', 'he', primary=True)
    ralbag_on_ruth.key = 'Ralbag Ruth'
    ralbag_on_ruth.append(create_commentary_node())
    ralbag_on_ruth.append(create_toalot_node())
    return ralbag_on_ruth
def create_schema():
    ralbag_on_ss = SchemaNode()
    ralbag_on_ss.add_title('Ralbag Song of Songs', 'en', primary=True)
    ralbag_on_ss.add_title(u'רלב"ג שיר השירים', 'he', primary=True)
    ralbag_on_ss.key = 'Ralbag Song of Songs'
    ralbag_on_ss.append(create_intro_nodes())
    ralbag_on_ss.append(create_commentary_node())
    return ralbag_on_ss
Beispiel #8
0
def rabbeinu_bahya_index():
    rb_on_humash = SchemaNode()
    rb_on_humash.add_title('Rabbeinu Bahya', 'en', primary=True)
    rb_on_humash.add_title(u'רבינו בחיי', 'he', primary=True)
    rb_on_humash.key = 'Rabbeinu Bahya'
    rb_on_humash.append(create_intro_nodes())
    for en_names, he_names in zip(english_names, hebrew_names):
        rb_on_humash.append(create_book_node(en_names, he_names))
    return rb_on_humash
Beispiel #9
0
 def build_node(self):
     """
     Builds the root schema node for the commentary
     :return: SchemaNode
     """
     node = SchemaNode()
     he_title = self.get_author()
     node.add_primary_titles(commentatorNames[he_title], he_title)
     return node
def chapter_seven(number):
    hebrew_letter = util.numToHeb(number)
    chapter = SchemaNode()
    chapter.add_title('Chapter {}'.format(number), "en", primary=True)
    chapter.add_title(u'{} {}'.format(u'סימן', hebrew_letter), "he", primary=True)
    chapter.key = 'Chapter {}'.format(number)
    chapter.append(create_intro_nodes())
    chapter.append(create_shorash_node())
    return chapter
Beispiel #11
0
def create_book_node(en_dict, he_dict):
    book = SchemaNode()
    book.key = 'Sefer {}'.format(en_dict[0])
    book.add_title('Sefer {}'.format(en_dict[0]), 'en', primary=True)
    book.add_title(u'ספר {}'.format(he_dict[0]), 'he', primary=True)
    if en_dict[0] == u'Bereshit':
        book.append(create_intro_nodes())
    for en_name, he_name in zip(en_dict, he_dict):
        book.append(create_parsha_node(en_name, he_name))
    return book
Beispiel #12
0
def create_positive_node():
    positive_node = SchemaNode()
    positive_node.add_title("Positive Commandments", "en", primary=True)
    positive_node.add_title(u"מצות עשה", "he", primary=True)
    positive_node.key = "Positive Commandments"
    positive_node.append(create_default_nodes())
    return positive_node
def create_book_node(english_parsha_names, hebrew_parsha_names):
    book = SchemaNode()
    book.key = 'Sefer {}'.format(english_parsha_names[0])
    book.add_title('Sefer {}'.format(english_parsha_names[0]), 'en', primary=True)
    book.add_title(u'ספר {}'.format(hebrew_parsha_names[0]), 'he', primary=True)
    for en_name in english_parsha_names:
        book.append(create_parsha_node(en_name))
    return book
def create_parsha_node(english_parsha_name):
    dictionary = create_alt_struct_refs()
    parsha_node = SchemaNode()
    parsha_node.add_shared_term(english_parsha_name)
    parsha_node.key = english_parsha_name
    parsha_node.append(create_alt_struct_intro_nodes(dictionary[english_parsha_name]['intro'], 'Introduction', u'הקדמה'))
    parsha_node.append(create_jagged_array_node(english_parsha_name, dictionary[english_parsha_name]['comments']))
    return parsha_node
def create_communal_node():
    communal = SchemaNode()
    communal.add_title('Communal Laws', 'en', primary=True)
    communal.add_title(u'מנין הפרשיות', 'he', primary=True)
    communal.key = 'Communal Laws'
    communal.append(create_depth_two_intro_nodes())
    communal.append(create_default_nodes())
    return communal
Beispiel #16
0
def create_communal_laws_nodes():
    communal_laws = SchemaNode()
    communal_laws.add_title("Communal Laws", "en", primary=True)
    communal_laws.add_title(u"פרשיות ציבור", "he", primary=True)
    communal_laws.key = "Communal Laws"
    communal_laws.append(create_intro_nodes())
    communal_laws.append(create_default_nodes())
    return communal_laws
Beispiel #17
0
def create_parsha_node(parhsa_name_en, parsha_name_he):
    parsha = SchemaNode()
    parsha.key = parhsa_name_en
    parsha.add_shared_term(parhsa_name_en)
    if parhsa_name_en is not u'Bereshit':
        parsha_one_intro_node = create_intro_nodes()
        parsha.append(parsha_one_intro_node)
    parsha_one_content_node = create_jagged_array_node()
    parsha.append(parsha_one_content_node)
    return parsha
def create_the_schema():
    english_names = ['Genesis', 'Exodus', 'Leviticus', 'Numbers', 'Deuteronomy']
    hebrew_names = [u'בראשית', u'שמות', u'ויקרא', u'במדבר', u'דברים']
    targum_jerusalem = SchemaNode()
    targum_jerusalem.add_title('Targum Jerusalem', 'en', primary=True)
    targum_jerusalem.add_title(u'תרגום ירושלמי', 'he', primary=True)
    targum_jerusalem.key = 'Targum Jerusalem'
    for english_name, hebrew_name in zip(english_names, hebrew_names):
        targum_jerusalem.append(create_jagged_array_nodes(english_name, hebrew_name))
    return targum_jerusalem
    def test_validate_children(self):
        """
        Does validate fall through to children?
        """
        s = SchemaNode()
        s.key = "root"
        s.add_title("root", "en", primary=True)
        j = JaggedArrayNode()
        j.add_title("child", "en", primary=True)
        j.key = "child"
        j.depth = 1
        j.sectionNames = ["Foo"]
        j.append_to(s)

        with pytest.raises(IndexSchemaError):
            s.validate()
    def test_terms_and_he(self):
        s = SchemaNode()
        s.key = "root"
        s.add_title("root", "en", primary=True)
        s.add_title(u"שרש", "he", primary=True)

        j = JaggedArrayNode()
        j.key = "bereshit"
        j.depth = 1
        j.sectionNames = ["Foo"]
        j.addressTypes = ["Integer"]
        j.add_shared_term("Bereshit")
        j.append_to(s)

        j2 = JaggedArrayNode()
        j2.key = "noah"
        j2.depth = 1
        j2.sectionNames = ["Foo"]
        j2.addressTypes = ["Integer"]
        j2.add_shared_term("Noach")
        j2.append_to(s)

        s.validate()

        td = s.title_dict("he")
        assert len(td) == 5

        target = {
            u'שרש': s,
            u'שרש, בראשית': j,
            u'שרש, נח': j2,
            u'שרש בראשית': j,
            u'שרש נח': j2,
        }

        assert td == target
    def test_default_chain(self):
        s = SchemaNode()
        s.key = "root"
        s.add_title("root", "en", primary=True)
        s.add_title("alt root", "en")

        s2 = SchemaNode()
        s2.key = "default"
        s2.default = True
        s2.append_to(s)

        j = JaggedArrayNode()
        j.key = "default"
        j.depth = 1
        j.default = True
        j.sectionNames = ["Foo"]
        j.addressTypes = ["Integer"]
        j.append_to(s2)

        s.validate()

        assert s.has_numeric_continuation()
        assert s2.has_numeric_continuation()
        assert j.has_numeric_continuation()
        assert not s.has_titled_continuation()
        assert not s2.has_titled_continuation()
        assert not j.has_titled_continuation()
    def test_grandchild_presentation(self):
        s = SchemaNode()
        s.key = "root"
        s.add_title("root", "en", primary=True)
        s.add_title("alt root", "en")

        s2 = SchemaNode()
        s2.key = "l2"
        s2.add_title("Level 2", "en", primary=True)
        s2.add_title("Level 2 Alone", "en", presentation="alone")
        s2.add_title("Level 2 Both", "en", presentation="both")
        s2.append_to(s)

        j = JaggedArrayNode()
        j.key = "child1"
        j.depth = 1
        j.sectionNames = ["Foo"]
        j.addressTypes = ["Integer"]
        j.add_title("Level 3a", "en", primary=True)
        j.add_title("Level 3a alone", "en", presentation="alone")
        j.add_title("Level 3a both", "en", presentation="both")
        j.append_to(s2)

        j2 = JaggedArrayNode()
        j2.key = "child2"
        j2.depth = 1
        j2.sectionNames = ["Foo"]
        j2.addressTypes = ["Integer"]
        j2.add_title("Level 3b", "en", primary=True)
        j2.add_title("Level 3b alone", "en", presentation="alone")
        j2.add_title("Level 3b both", "en", presentation="both")
        j2.append_to(s2)

        s.validate()

        assert not s.has_numeric_continuation()
        assert not s2.has_numeric_continuation()

        td = s.title_dict()
        assert len(td) == 96

        target = {
            "root": s,
            "alt root": s,
            "Level 2 Alone": s2,
            "Level 3b alone": j2,
            "Level 3a alone": j,
            "Level 2 Both": s2,
            "Level 3a both": j,
            "Level 3b both": j2,

            # combined, with comma separator
            "root, Level 2 Both": s2,
            "root, Level 2": s2,
            "alt root, Level 2 Both": s2,
            "alt root, Level 2": s2,

            "root, Level 2 Both, Level 3a": j,
            "root, Level 2, Level 3a": j,
            "alt root, Level 2 Both, Level 3a": j,
            "alt root, Level 2, Level 3a": j,
            "Level 2 Alone, Level 3a": j,
            "Level 2 Both, Level 3a": j,

            "root, Level 2 Both, Level 3a both": j,
            "root, Level 2, Level 3a both": j,
            "alt root, Level 2 Both, Level 3a both": j,
            "alt root, Level 2, Level 3a both": j,
            "Level 2 Alone, Level 3a both": j,
            "Level 2 Both, Level 3a both": j,

            "root, Level 2 Both, Level 3b": j2,
            "root, Level 2, Level 3b": j2,
            "alt root, Level 2 Both, Level 3b": j2,
            "alt root, Level 2, Level 3b": j2,
            "Level 2 Alone, Level 3b": j2,
            "Level 2 Both, Level 3b": j2,

            "root, Level 2 Both, Level 3b both": j2,
            "root, Level 2, Level 3b both": j2,
            "alt root, Level 2 Both, Level 3b both": j2,
            "alt root, Level 2, Level 3b both": j2,
            "Level 2 Alone, Level 3b both": j2,
            "Level 2 Both, Level 3b both": j2,

            # combined, with space separator
            "root Level 2 Both": s2,
            "root Level 2": s2,
            "alt root Level 2 Both": s2,
            "alt root Level 2": s2,

            "root Level 2 Both Level 3a": j,
            "root Level 2 Level 3a": j,
            "alt root Level 2 Both Level 3a": j,
            "alt root Level 2 Level 3a": j,
            "Level 2 Alone Level 3a": j,
            "Level 2 Both Level 3a": j,

            "root Level 2 Both Level 3a both": j,
            "root Level 2 Level 3a both": j,
            "alt root Level 2 Both Level 3a both": j,
            "alt root Level 2 Level 3a both": j,
            "Level 2 Alone Level 3a both": j,
            "Level 2 Both Level 3a both": j,

            "root Level 2 Both Level 3b": j2,
            "root Level 2 Level 3b": j2,
            "alt root Level 2 Both Level 3b": j2,
            "alt root Level 2 Level 3b": j2,
            "Level 2 Alone Level 3b": j2,
            "Level 2 Both Level 3b": j2,

            "root Level 2 Both Level 3b both": j2,
            "root Level 2 Level 3b both": j2,
            "alt root Level 2 Both Level 3b both": j2,
            "alt root Level 2 Level 3b both": j2,
            "Level 2 Alone Level 3b both": j2,
            "Level 2 Both Level 3b both": j2,

            # combined, space, comma
            "root Level 2 Both, Level 3a": j,
            "root Level 2, Level 3a": j,
            "alt root Level 2 Both, Level 3a": j,
            "alt root Level 2, Level 3a": j,
            "root Level 2 Both, Level 3a both": j,
            "root Level 2, Level 3a both": j,
            "alt root Level 2 Both, Level 3a both": j,
            "alt root Level 2, Level 3a both": j,
            "root Level 2 Both, Level 3b": j2,
            "root Level 2, Level 3b": j2,
            "alt root Level 2 Both, Level 3b": j2,
            "alt root Level 2, Level 3b": j2,
            "root Level 2 Both, Level 3b both": j2,
            "root Level 2, Level 3b both": j2,
            "alt root Level 2 Both, Level 3b both": j2,
            "alt root Level 2, Level 3b both": j2,

            # combined, comma, space
            "root, Level 2 Both Level 3a": j,
            "root, Level 2 Level 3a": j,
            "alt root, Level 2 Both Level 3a": j,
            "alt root, Level 2 Level 3a": j,
            "root, Level 2 Both Level 3a both": j,
            "root, Level 2 Level 3a both": j,
            "alt root, Level 2 Both Level 3a both": j,
            "alt root, Level 2 Level 3a both": j,
            "root, Level 2 Both Level 3b": j2,
            "root, Level 2 Level 3b": j2,
            "alt root, Level 2 Both Level 3b": j2,
            "alt root, Level 2 Level 3b": j2,
            "root, Level 2 Both Level 3b both": j2,
            "root, Level 2 Level 3b both": j2,
            "alt root, Level 2 Both Level 3b both": j2,
            "alt root, Level 2 Level 3b both": j2,

        }

        assert td == target
Beispiel #23
0
    def test_presentation_and_default(self):
        s = SchemaNode()
        s.key = "root"
        s.add_title("root", "en", primary=True)

        j2 = JaggedArrayNode()
        j2.key = "default"
        j2.default = True
        j2.depth = 1
        j2.sectionNames = ["Foo"]
        j2.addressTypes = ["Integer"]
        s.append(j2)

        assert not s.has_titled_continuation()

        j = JaggedArrayNode()
        j.key = "child1"
        j.depth = 1
        j.sectionNames = ["Foo"]
        j.addressTypes = ["Integer"]
        j.add_title("Child 1", "en", primary=True)
        j.add_title("Sweet Child", "en", presentation="alone")
        j.add_title("Sweet Child of Mine", "en", presentation="both")
        s.append(j)

        s.validate()

        assert s.has_titled_continuation()
        assert s.has_numeric_continuation()
        assert not j.has_titled_continuation()
        assert not j2.has_titled_continuation()
        assert j2.has_numeric_continuation()
        assert j.has_numeric_continuation()

        td = s.title_dict()
        assert len(td) == 7

        target = {
            'root': j2,
            'root, Child 1': j,
            'root, Sweet Child of Mine': j,
            'root Child 1': j,
            'root Sweet Child of Mine': j,
            'Sweet Child of Mine': j,
            'Sweet Child': j,
        }

        assert td == target
def create_book_intro_node():
    intro_node = SchemaNode()
    intro_node.add_title('Introduction', "en", primary=True)
    intro_node.add_title(u'מבוא', "he", primary=True)
    intro_node.key = 'Introduction'
    for number in range(1, 7):
        intro_node.append(regular_chapter_nodes(number))
    intro_node.append(chapter_seven(7))
    intro_node.append(regular_chapter_nodes(8))
    intro_node.append(chapter_nine(9))
    for number in range(10, 13):
        intro_node.append(regular_chapter_nodes(number))
    return intro_node
def new_index(english_names, hebrew_names):
    rb_on_humash = SchemaNode()
    rb_on_humash.add_title('Rabbeinu Bahya', 'en', primary=True)
    rb_on_humash.add_title(u'רבינו בחיי', 'he', primary=True)
    rb_on_humash.key = 'Rabbeinu Bahya'
    rb_on_humash.append(create_intro_nodes())
    for english_book_name, hebrew_book_name in zip(english_names, hebrew_names):
        rb_on_humash.append(create_book_ja_node(english_book_name, hebrew_book_name))
    return rb_on_humash
def rabbeinu_bahya_alt_struct(english_names, hebrew_names):
    rb_on_humash = SchemaNode()
    rb_on_humash.append(create_alt_struct_intro_nodes('Rabbeinu_Bahya,_Introduction.1-5', 'Introduction to the Book', u'הקדמה לספר', include_section=False))
    for english_parsha_names, hebrew__parsha_names in zip(english_names, hebrew_names):
        rb_on_humash.append(create_book_node(english_parsha_names, hebrew__parsha_names))
    return rb_on_humash
Beispiel #27
0
def create_schema():
    lev_sameach = SchemaNode()
    lev_sameach.add_title('Lev Sameach', 'en', primary=True)
    lev_sameach.add_title(u'לב שמח', 'he', primary=True)
    lev_sameach.key = 'Lev Sameach'
    lev_sameach.append(create_shorash_node())
    lev_sameach.append(
        create_mitzvah_node('Positive Commandments', u'מצוה עשה'))
    lev_sameach.append(
        create_mitzvah_node('Negative Commandments', u'מצוה לא תעשה'))
    return lev_sameach
Beispiel #28
0
def create_schema():
    ralbag_on_ss = SchemaNode()
    ralbag_on_ss.add_title('Ralbag Song of Songs', 'en', primary=True)
    ralbag_on_ss.add_title(u'רלב"ג שיר השירים', 'he', primary=True)
    ralbag_on_ss.key = 'Ralbag Song of Songs'
    ralbag_on_ss.append(create_intro_nodes())
    ralbag_on_ss.append(create_commentary_node())
    return ralbag_on_ss
Beispiel #29
0
def construct_index():
    root = SchemaNode()
    root.add_title('Chesed LeAvraham', 'en', primary=True)
    root.add_title(u'חסד לאברהם', 'he', primary=True)
    root.key = 'Chesed LeAvraham'

    intro = JaggedArrayNode()
    intro.add_title('Introduction', 'en', primary=True)
    intro.add_title(u'הקדמה', 'he', primary=True)
    intro.key = 'Introduction'
    intro.depth = 1
    intro.sectionNames = ['Paragraph']
    intro.addressTypes = ['Integer']
    intro.validate()
    root.append(intro)

    even = JaggedArrayNode()
    even.add_title('Even Shetiya', 'en', primary=True)
    even.add_title(u'אבן שתיה', 'he', primary=True)
    even.key = 'Even Shetiya'
    even.sectionNames = ['Maayan']
    even.depth = 1
    even.addressTypes = ['Integer']

    maayanot = [u'עין כל', u'עין הקורא', u'עין הארץ', u'עין יעקב', u'עין משפט', u'עין גנים', u'עין גדי']
    for i, title in enumerate(maayanot):
        node = JaggedArrayNode()
        node.add_title('Maayan {}'.format(i+1), 'en', primary=True)
        node.add_title(title, 'he', primary=True)
        node.key = 'Maayan {}'.format(i+1)
        node.depth = 2
        node.sectionNames = ['Nahar', 'Paragraph']
        node.addressTypes = ['Integer', 'Integer']
        node.validate()
        even.append(node)
    even.validate()
    root.append(even)

    breichat = JaggedArrayNode()
    breichat.add_title('Breichat Avraham', 'en', primary=True)
    breichat.add_title(u'בריכת אברהם', 'he', primary=True)
    breichat.key = 'Breichat Avraham'
    breichat.depth = 2
    breichat.sectionNames = ['Shoket', 'Paragraph']
    breichat.addressTypes = ['Integer', 'Integer']
    breichat.validate()
    root.append(breichat)

    root.validate()
    return {
        'title': 'Chesed LeAvraham',
        'categories': ['Kabbalah'],
        'schema': root.serialize()
    }
Beispiel #30
0
def post():

    root = SchemaNode()
    root.add_title('Pardes Rimonim', 'en', primary=True)
    root.add_title(u'פרדס רימונים', 'he', primary=True)
    root.key = 'Pardes Rimonim'

    anode = JaggedArrayNode()
    anode.add_title("Author's Introduction", 'en', primary=True)
    anode.add_title(u'הקדמת המחבר', 'he', primary=True)
    anode.key = "Author's Introduction"
    anode.depth = 1
    anode.addressTypes = ['Integer']
    anode.sectionNames = ['Paragraph']
    root.append(anode)

    inode = JaggedArrayNode()
    inode.add_title("Index", 'en', primary=True)
    inode.add_title(u'סימני הספר', 'he', primary=True)
    inode.key = "Index"
    inode.depth = 2
    inode.addressTypes = ['Integer', 'Integer']
    inode.sectionNames = ['Gate', 'Chapter']
    root.append(inode)

    pnode = JaggedArrayNode()
    pnode.add_title("A Prayer", 'en', primary=True)
    pnode.add_title(u'בקשה', 'he', primary=True)
    pnode.key = "A Prayer"
    pnode.depth = 1
    pnode.addressTypes = ['Integer']
    pnode.sectionNames = ['Paragraph']
    root.append(pnode)

    dnode = JaggedArrayNode()
    dnode.default = True
    dnode.key = 'default'
    dnode.depth = 3
    dnode.addressTypes = ['Integer', 'Integer', 'Integer']
    dnode.sectionNames = ['Gate', 'Chapter', 'Paragraph']
    root.append(dnode)
    root.validate()

    index = {
        "pubDate": "1651",
        "title": "Pardes Rimonim",
        "pubPlace": "Amsterdam",
        "enDesc": "Pardes Rimonim (Orchard of Pomegranates) is a primary text of Kabbalah composed by the Jewish mystic Moses ben Jacob Cordovero in Safed. It is composed of thirteen gates or sections each subdivided into chapters. He indicates in his introduction that the work is based upon notes he took during his study of the Zohar, the foundational work of the Kabbalahand was designed \"in order not to become lost and confused in its [the Zohar] depths\". The work is an encyclopaedic summary of the Kabbalah, including an effort to \"elucidate all the tenets of the Cabala, such as the doctrines of the sefirot, emanation, the divine names, the import and significance of the alphabet, etc.\" Pardes Rimonim was the first comprehensive exposition of Medieval Kabbalah, though its rationally influenced scheme was superseded by the subsequent 16th century Safed mythological scheme of Isaac Luria.",
        "era": "RI",
        "authors": ["Moshe Cordovero"],
        "categories": ["Kabbalah"],
        'schema': root.serialize()
    }
    version = {
        'versionTitle': 'Pardes Rimonim',
        'versionSource': 'http://www.hebrew.grimoar.cz/kordovero/pardes_rimonim.htm',
        'language': 'he',
        'text': parse()
    }
    post_index(index)
    post_text('Pardes Rimonim', version, index_count='on', skip_links=1)
def create_schema():
    rasag_commentary = SchemaNode()
    rasag_commentary.add_title('Commentary on Sefer Hamitzvot of Rasag', 'en', primary=True)
    rasag_commentary.add_title(u'ביאור על ספר המצוות לרס"ג', 'he', primary=True)
    rasag_commentary.key = 'Commentary on Sefer Hamitzvot of Rasag'
    rasag_commentary.append(create_book_intro_node())
    rasag_commentary.append(create_positive_commandments_node())
    rasag_commentary.append(create_negative_commandments_node())
    rasag_commentary.append(create_onshim_node())
    rasag_commentary.append(create_communal_node())
    rasag_commentary.append(create_miluim_node())
    return rasag_commentary
    def test_grandchild_presentation(self):
        s = SchemaNode()
        s.key = "root"
        s.add_title("root", "en", primary=True)
        s.add_title("alt root", "en")

        s2 = SchemaNode()
        s2.key = "l2"
        s2.add_title("Level 2", "en", primary=True)
        s2.add_title("Level 2 Alone", "en", presentation="alone")
        s2.add_title("Level 2 Both", "en", presentation="both")
        s2.append_to(s)

        j = JaggedArrayNode()
        j.key = "child1"
        j.depth = 1
        j.sectionNames = ["Foo"]
        j.addressTypes = ["Integer"]
        j.add_title("Level 3a", "en", primary=True)
        j.add_title("Level 3a alone", "en", presentation="alone")
        j.add_title("Level 3a both", "en", presentation="both")
        j.append_to(s2)

        j2 = JaggedArrayNode()
        j2.key = "child2"
        j2.depth = 1
        j2.sectionNames = ["Foo"]
        j2.addressTypes = ["Integer"]
        j2.add_title("Level 3b", "en", primary=True)
        j2.add_title("Level 3b alone", "en", presentation="alone")
        j2.add_title("Level 3b both", "en", presentation="both")
        j2.append_to(s2)

        s.validate()

        assert not s.has_numeric_continuation()
        assert not s2.has_numeric_continuation()

        td = s.title_dict()
        assert len(td) == 96

        target = {
            "root": s,
            "alt root": s,
            "Level 2 Alone": s2,
            "Level 3b alone": j2,
            "Level 3a alone": j,
            "Level 2 Both": s2,
            "Level 3a both": j,
            "Level 3b both": j2,

            # combined, with comma separator
            "root, Level 2 Both": s2,
            "root, Level 2": s2,
            "alt root, Level 2 Both": s2,
            "alt root, Level 2": s2,
            "root, Level 2 Both, Level 3a": j,
            "root, Level 2, Level 3a": j,
            "alt root, Level 2 Both, Level 3a": j,
            "alt root, Level 2, Level 3a": j,
            "Level 2 Alone, Level 3a": j,
            "Level 2 Both, Level 3a": j,
            "root, Level 2 Both, Level 3a both": j,
            "root, Level 2, Level 3a both": j,
            "alt root, Level 2 Both, Level 3a both": j,
            "alt root, Level 2, Level 3a both": j,
            "Level 2 Alone, Level 3a both": j,
            "Level 2 Both, Level 3a both": j,
            "root, Level 2 Both, Level 3b": j2,
            "root, Level 2, Level 3b": j2,
            "alt root, Level 2 Both, Level 3b": j2,
            "alt root, Level 2, Level 3b": j2,
            "Level 2 Alone, Level 3b": j2,
            "Level 2 Both, Level 3b": j2,
            "root, Level 2 Both, Level 3b both": j2,
            "root, Level 2, Level 3b both": j2,
            "alt root, Level 2 Both, Level 3b both": j2,
            "alt root, Level 2, Level 3b both": j2,
            "Level 2 Alone, Level 3b both": j2,
            "Level 2 Both, Level 3b both": j2,

            # combined, with space separator
            "root Level 2 Both": s2,
            "root Level 2": s2,
            "alt root Level 2 Both": s2,
            "alt root Level 2": s2,
            "root Level 2 Both Level 3a": j,
            "root Level 2 Level 3a": j,
            "alt root Level 2 Both Level 3a": j,
            "alt root Level 2 Level 3a": j,
            "Level 2 Alone Level 3a": j,
            "Level 2 Both Level 3a": j,
            "root Level 2 Both Level 3a both": j,
            "root Level 2 Level 3a both": j,
            "alt root Level 2 Both Level 3a both": j,
            "alt root Level 2 Level 3a both": j,
            "Level 2 Alone Level 3a both": j,
            "Level 2 Both Level 3a both": j,
            "root Level 2 Both Level 3b": j2,
            "root Level 2 Level 3b": j2,
            "alt root Level 2 Both Level 3b": j2,
            "alt root Level 2 Level 3b": j2,
            "Level 2 Alone Level 3b": j2,
            "Level 2 Both Level 3b": j2,
            "root Level 2 Both Level 3b both": j2,
            "root Level 2 Level 3b both": j2,
            "alt root Level 2 Both Level 3b both": j2,
            "alt root Level 2 Level 3b both": j2,
            "Level 2 Alone Level 3b both": j2,
            "Level 2 Both Level 3b both": j2,

            # combined, space, comma
            "root Level 2 Both, Level 3a": j,
            "root Level 2, Level 3a": j,
            "alt root Level 2 Both, Level 3a": j,
            "alt root Level 2, Level 3a": j,
            "root Level 2 Both, Level 3a both": j,
            "root Level 2, Level 3a both": j,
            "alt root Level 2 Both, Level 3a both": j,
            "alt root Level 2, Level 3a both": j,
            "root Level 2 Both, Level 3b": j2,
            "root Level 2, Level 3b": j2,
            "alt root Level 2 Both, Level 3b": j2,
            "alt root Level 2, Level 3b": j2,
            "root Level 2 Both, Level 3b both": j2,
            "root Level 2, Level 3b both": j2,
            "alt root Level 2 Both, Level 3b both": j2,
            "alt root Level 2, Level 3b both": j2,

            # combined, comma, space
            "root, Level 2 Both Level 3a": j,
            "root, Level 2 Level 3a": j,
            "alt root, Level 2 Both Level 3a": j,
            "alt root, Level 2 Level 3a": j,
            "root, Level 2 Both Level 3a both": j,
            "root, Level 2 Level 3a both": j,
            "alt root, Level 2 Both Level 3a both": j,
            "alt root, Level 2 Level 3a both": j,
            "root, Level 2 Both Level 3b": j2,
            "root, Level 2 Level 3b": j2,
            "alt root, Level 2 Both Level 3b": j2,
            "alt root, Level 2 Level 3b": j2,
            "root, Level 2 Both Level 3b both": j2,
            "root, Level 2 Level 3b both": j2,
            "alt root, Level 2 Both Level 3b both": j2,
            "alt root, Level 2 Level 3b both": j2,
        }

        assert td == target
    def test_default_chain(self):
        s = SchemaNode()
        s.key = "root"
        s.add_title("root", "en", primary=True)
        s.add_title(u"שורש", "he", primary=True)
        s.add_title("alt root", "en")

        s2 = SchemaNode()
        s2.key = "default"
        s2.default = True
        s2.append_to(s)

        j = JaggedArrayNode()
        j.key = "default"
        j.depth = 1
        j.default = True
        j.sectionNames = ["Foo"]
        j.addressTypes = ["Integer"]
        j.append_to(s2)

        s.validate()

        assert s.has_numeric_continuation()
        assert s2.has_numeric_continuation()
        assert j.has_numeric_continuation()
        assert not s.has_titled_continuation()
        assert not s2.has_titled_continuation()
        assert not j.has_titled_continuation()
Beispiel #34
0
def create_schema():
    rasag = SchemaNode()
    rasag.add_title("Sefer Hamitzvot of Rasag", "en", primary=True)
    rasag.add_title(u'ספר המצוות לרס"ג', "he", primary=True)
    rasag.key = "Sefer Hamitzvot of Rasag"
    rasag.append(create_positive_node())
    rasag.append(create_negative_node())
    rasag.append(create_laws_of_the_court_node())
    rasag.append(create_communal_laws_nodes())
    return rasag
Beispiel #35
0
def create_schema():
    rasag = SchemaNode()
    rasag.add_title('Sefer Hamitzvot of Rasag', 'en', primary=True)
    rasag.add_title(u'ספר המצוות לרס"ג', 'he', primary=True)
    rasag.key = 'Sefer Hamitzvot of Rasag'
    rasag.append(create_positive_node())
    rasag.append(create_negative_node())
    rasag.append(create_laws_of_the_court_node())
    rasag.append(create_communal_laws_nodes())
    return rasag
Beispiel #36
0
def create_negative_node():
    negative_node = SchemaNode()
    negative_node.add_title('Negative Commandments', "en", primary=True)
    negative_node.add_title(u'מצות לא תעשה', "he", primary=True)
    negative_node.key = 'Negative Commandments'
    negative_node.append(create_intro_nodes())
    negative_node.append(create_default_nodes())
    return negative_node
def create_schema():
    ralbag_on_esther = SchemaNode()
    ralbag_on_esther.add_title('Ralbag Esther', 'en', primary=True)
    ralbag_on_esther.add_title(u'רלב"ג אסתר', 'he', primary=True)
    ralbag_on_esther.key = 'Ralbag Esther'
    ralbag_on_esther.append(create_intro_nodes())
    ralbag_on_esther.append(create_commentary_node())
    ralbag_on_esther.append(create_toalot_node())
    return ralbag_on_esther
Beispiel #38
0
def create_laws_of_the_court_node():
    law_of_court = SchemaNode()
    law_of_court.add_title('Laws of the Courts', "en", primary=True)
    law_of_court.add_title(u'עונשים', "he", primary=True)
    law_of_court.key = 'Laws of the Courts'
    law_of_court.append(create_intro_nodes())
    law_of_court.append(create_default_nodes())
    return law_of_court
def create_schema():
    lev_sameach = SchemaNode()
    lev_sameach.add_title('Lev Sameach', 'en', primary=True)
    lev_sameach.add_title(u'לב שמח', 'he', primary=True)
    lev_sameach.key = 'Lev Sameach'
    lev_sameach.append(create_shorash_node())
    lev_sameach.append(create_mitzvah_node('Positive Commandments', u'מצוה עשה'))
    lev_sameach.append(create_mitzvah_node('Negative Commandments', u'מצוה לא תעשה'))
    return lev_sameach
Beispiel #40
0
def create_schema():
    ralbag_on_ruth = SchemaNode()
    ralbag_on_ruth.add_title('Ralbag Ruth', 'en', primary=True)
    ralbag_on_ruth.add_title(u'רלב"ג רות', 'he', primary=True)
    ralbag_on_ruth.key = 'Ralbag Ruth'
    ralbag_on_ruth.append(create_commentary_node())
    ralbag_on_ruth.append(create_toalot_node())
    return ralbag_on_ruth