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


Python JaggedArrayNode.add_title方法代码示例

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


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

示例1: test_jaggedarray_fields

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
    def test_jaggedarray_fields(self):

        j = JaggedArrayNode()
        j.add_title(u"title1", "en", primary=True)\
         .add_title(u"ייי", "he", primary=True)\
         .add_title(u"title2", "en")\
         .add_title(u"ייכי", "he")
        j.depth = 1
        j.sectionNames = ["Foo"]
        j.addressTypes = ["Integer"]
        j.key = "bob"

        j.validate()

        for f in ["depth", "sectionNames", "addressTypes", "key"]:
            t = copy.deepcopy(j)
            delattr(t, f)

            with pytest.raises(IndexSchemaError):
                t.validate()

        t = copy.deepcopy(j)
        t.sectionNames += ["foob"]
        with pytest.raises(IndexSchemaError):
            t.validate()

        t = copy.deepcopy(j)
        t.addressTypes += ["Integer"]
        with pytest.raises(IndexSchemaError):
            t.validate()
开发者ID:JonMosenkis,项目名称:Sefaria-Project,代码行数:32,代码来源:node_test.py

示例2: post_yitzira

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def post_yitzira():
    node = JaggedArrayNode()
    node.add_title('Sefer Yetzirah', 'en', primary=True)
    node.add_title(u'ספר יצירה', 'he', primary=True)
    node.key = 'Sefer Yetzirah'
    node.depth = 2
    node.addressTypes = ['Integer', 'Integer']
    node.sectionNames = ['Chapter', 'Mishnah']
    node.validate()

    y_index = {
        'title': 'Sefer Yetzirah',
        'categories': ['Kabbalah'],
        'language': 'he',
        'schema': node.serialize()
    }

    y_version = {
        'versionTitle': 'Sefer Yetzirah, Warsaw 1884',
        'versionSource': 'http://primo.nli.org.il/primo_library/libweb/action/dlDisplay.do?vid=NLI&docId=NNL_ALEPH001310968',
        'language': 'he',
        'text': parse_yitzira()
    }
    post_index(y_index)
    post_text("Sefer Yetzirah", y_version, index_count='on')
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:27,代码来源:yitzira_parser.py

示例3: create_intro_node

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_intro_node():
    intro = JaggedArrayNode()
    intro.add_title('Introduction', 'en', primary=True)
    intro.add_title(u'הקדמה', 'he', primary=True)
    intro.key = 'Introduction'
    intro.depth = 1
    intro.addressTypes = ["Integer"]
    intro.sectionNames = ["Comment"]
    return intro
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:eee_functions.py

示例4: create_schema

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_schema():
    rif_on_nedarim = JaggedArrayNode()
    rif_on_nedarim.add_title('Rif_Nedarim', 'en', primary=True)
    rif_on_nedarim.add_title(u'רי"ף נדרים', 'he', primary=True)
    rif_on_nedarim.key = 'Rif_Nedarim'
    rif_on_nedarim.depth = 2
    rif_on_nedarim.addressTypes = ["Talmud", "Integer"]
    rif_on_nedarim.sectionNames = ["Daf", "Line"]
    return rif_on_nedarim
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:rif_nedarim_functions.py

示例5: create_jagged_array_nodes

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_jagged_array_nodes(en_name, he_name):
    book_node = JaggedArrayNode()
    book_node.key = en_name
    book_node.add_title(en_name, 'en', primary=True)
    book_node.add_title(he_name, 'he', primary=True)
    book_node.depth = 2
    book_node.addressTypes = ["Integer", "Integer"]
    book_node.sectionNames = ["Chapter", "Verse"]
    return book_node
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:tjh_functions.py

示例6: create_mitzvah_node

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

示例7: create_shorash_node

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_shorash_node():
    intro_node = JaggedArrayNode()
    intro_node.add_title('Shorashim', "en", primary=True)
    intro_node.add_title(u'שורשים', "he", primary=True)
    intro_node.key = 'Shorashim'
    intro_node.depth = 2
    intro_node.addressTypes = ["Integer", "Integer"]
    intro_node.sectionNames = ["Shorash", "Comment"]
    return intro_node
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:rasag_commentary_index_record.py

示例8: create_negative_commandments_node

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_negative_commandments_node():
    negative_commandments = JaggedArrayNode()
    negative_commandments.add_title('Negative Commandments', 'en', primary=True)
    negative_commandments.add_title(u'מנין לא תעשה', 'he', primary=True)
    negative_commandments.key = 'Negative Commandments'
    negative_commandments.depth = 2
    negative_commandments.addressTypes = ["Integer", "Integer"]
    negative_commandments.sectionNames = ["Mitzvah", "Comment"]
    return negative_commandments
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:rasag_commentary_index_record.py

示例9: create_positive_commandments_node

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_positive_commandments_node():
    positive_commandments = JaggedArrayNode()
    positive_commandments.add_title('Positive Commandments', 'en', primary=True)
    positive_commandments.add_title(u'מנין עשה', 'he', primary=True)
    positive_commandments.key = 'Positive Commandments'
    positive_commandments.depth = 2
    positive_commandments.addressTypes = ["Integer", "Integer"]
    positive_commandments.sectionNames = ["Mitzvah", "Comment"]
    return positive_commandments
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:rasag_commentary_index_record.py

示例10: create_toalot_node

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_toalot_node():
    toalot = JaggedArrayNode()
    toalot.add_title('Benefits', "en", primary=True)
    toalot.add_title(u'תועלות', "he", primary=True)
    toalot.key = 'Benefits'
    toalot.depth = 1
    toalot.addressTypes = ["Integer"]
    toalot.sectionNames = ["Comment"]
    return toalot
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:ralbag_esther_functions.py

示例11: create_intro_nodes

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_intro_nodes():
    intro_node = JaggedArrayNode()
    intro_node.add_title('Introduction', "en", primary=True)
    intro_node.add_title(u'הצעה', "he", primary=True)
    intro_node.key = 'Introduction'
    intro_node.depth = 1
    intro_node.addressTypes = ["Integer"]
    intro_node.sectionNames = ["Comment"]
    return intro_node
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:ralbag_esther_functions.py

示例12: create_schema

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_schema():
    rb_schema = JaggedArrayNode()
    rb_schema.add_title('Rabbeinu Yonah on Pirkei Avot', 'en', primary=True)
    rb_schema.add_title(u'רבינו יונה על פרקי אבות', 'he', primary=True)
    rb_schema.key = 'Rabbeinu Yonah on Pirkei Avot'
    rb_schema.depth = 3
    rb_schema.addressTypes = ["Integer", "Integer", "Integer"]
    rb_schema.sectionNames = ["Perek", "Mishna", "Comment"]
    return rb_schema
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:rb_yonah_functions.py

示例13: create_schema

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_schema():
    ls_schema = JaggedArrayNode()
    ls_schema.add_title('Lechem Shamayim on Pirkei Avot', 'en', primary=True)
    ls_schema.add_title(u'לחם שמים על פרקי אבות', 'he', primary=True)
    ls_schema.key = 'Lechem Shamayim on Pirkei Avot'
    ls_schema.depth = 3
    ls_schema.addressTypes = ["Integer", "Integer", "Integer"]
    ls_schema.sectionNames = ["Perek", "Mishna", "Comment"]
    return ls_schema
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:ls_functions.py

示例14: create_shorash_node

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_shorash_node():
    shorash = JaggedArrayNode()
    shorash.add_title('Shorashim', 'en', primary=True)
    shorash.add_title(u'שורשים', 'he', primary=True)
    shorash.key = 'Shorashim'
    shorash.depth = 2
    shorash.addressTypes = ["Integer", "Integer"]
    shorash.sectionNames = ["Shoresh", "Comment"]
    return shorash
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:ls_functions.py

示例15: create_schema

# 需要导入模块: from sefaria.model.schema import JaggedArrayNode [as 别名]
# 或者: from sefaria.model.schema.JaggedArrayNode import add_title [as 别名]
def create_schema():
    gra_schema = JaggedArrayNode()
    gra_schema.add_title('Gra on Pirkei Avot', 'en', primary=True)
    gra_schema.add_title(u'גר"א על פרקי אבות', 'he', primary=True)
    gra_schema.key = 'Gra on Pirkei Avot'
    gra_schema.depth = 3
    gra_schema.addressTypes = ["Integer", "Integer", "Integer"]
    gra_schema.sectionNames = ["Perek", "Mishna", "Comment"]
    return gra_schema
开发者ID:JonMosenkis,项目名称:Sefaria-Data,代码行数:11,代码来源:gra_functions.py


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