当前位置: 首页>>代码示例>>Python>>正文


Python JaggedArrayNode.default方法代码示例

本文整理汇总了Python中sefaria.model.schema.JaggedArrayNode.default方法的典型用法代码示例。如果您正苦于以下问题:Python JaggedArrayNode.default方法的具体用法?Python JaggedArrayNode.default怎么用?Python JaggedArrayNode.default使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sefaria.model.schema.JaggedArrayNode的用法示例。


在下文中一共展示了JaggedArrayNode.default方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_default_chain

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import default [as 别名]
    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()
开发者ID:JonMosenkis,项目名称:Sefaria-Project,代码行数:29,代码来源:node_test.py

示例2: create_commentary_node

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import default [as 别名]
def create_commentary_node():
    commentary = JaggedArrayNode()
    commentary.default = True
    commentary.key = 'default'
    commentary.depth = 3
    commentary.addressTypes = ["Integer", "Integer", "Integer"]
    commentary.sectionNames = ["Perek", "Pasuk", "Comment"]
    return commentary
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:10,代码来源:ralbag_esther_functions.py

示例3: create_default_nodes

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import default [as 别名]
def create_default_nodes():
    default = JaggedArrayNode()
    default.default = True
    default.key = 'default'
    default.depth = 2
    default.addressTypes = ["Integer", "Integer"]
    default.sectionNames = ["Mitzvah", "Comment"]
    return default
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:10,代码来源:rasag_commentary_index_record.py

示例4: create_default_nodes

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import default [as 别名]
def create_default_nodes():
    default_node = JaggedArrayNode()
    default_node.key = "default"
    default_node.default = True
    default_node.depth = 1
    default_node.addressTypes = ["Integer"]
    default_node.sectionNames = ["Comment"]
    return default_node
开发者ID:,项目名称:,代码行数:10,代码来源:

示例5: create_jagged_array_node

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import default [as 别名]
def create_jagged_array_node():
    jagged_array_node = JaggedArrayNode()
    jagged_array_node.key = 'default'
    jagged_array_node.default = True
    jagged_array_node.depth = 1
    jagged_array_node.addressTypes = ["Integer"]
    jagged_array_node.sectionNames = ["Comment"]
    return jagged_array_node
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:10,代码来源:function.py

示例6: test_presentation_and_default

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import default [as 别名]
    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
开发者ID:JonMosenkis,项目名称:Sefaria-Project,代码行数:50,代码来源:node_test.py

示例7: post

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import default [as 别名]
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)
开发者ID:,项目名称:,代码行数:63,代码来源:


注:本文中的sefaria.model.schema.JaggedArrayNode.default方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。