當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。