• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python library.get_refs_in_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sefaria.model.text.library.get_refs_in_string函数的典型用法代码示例。如果您正苦于以下问题:Python get_refs_in_string函数的具体用法?Python get_refs_in_string怎么用?Python get_refs_in_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test_commentary

 def test_commentary(self):
     s = "Here's one with Rashi on Genesis 2:5:3"
     s2 = "Here's one with both Rashi on Genesis 3:4 and Exodus 5:2. yeah"
     s3 = "Here's one with Genesis 2:3"
     assert library.get_refs_in_string(s, "en") == [Ref("Rashi on Genesis 2:5:3")]
     assert library.get_refs_in_string(s2, "en") == [Ref("Rashi on Genesis 3:4"), Ref("Exodus 5:2")]
     assert library.get_refs_in_string(s3, "en") == [Ref("Genesis 2:3")]
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:7,代码来源:library_test.py


示例2: test_two_single_quotes

    def test_two_single_quotes(self):
        ref = library.get_refs_in_string(u"עין ממש דכתיב (במדבר ל''ה) ולא תקחו")
        assert 1 == len(ref)
        assert ref[0] == Ref(u"במדבר ל''ה")

        ref = library.get_refs_in_string(u"דאמר קרא (שופטים כ י''א) ויאסף כל איש")
        assert 1 == len(ref)
        assert ref[0] == Ref(u"שופטים כ י''א")
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:8,代码来源:library_test.py


示例3: test_word_boundary

    def test_word_boundary(self):
        st = u' את הכל, ובאגדה (אסתר רבה פתיחתא, יא) שמעון בן זומא בשם'
        ref = library.get_refs_in_string(st)
        assert len(ref) == 0

        #Assumes that Yalkut Shimoni Esther is not a text
        st = u"""ובמדרש (ילקוט שמעוני אסתר א, סי' חתרמ"ו) מהיכן היה לו"""
        ref = library.get_refs_in_string(st)
        assert len(ref) == 1
        assert ref[0].sections[0] == 1
        assert len(ref[0].sections) == 1
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:11,代码来源:library_test.py


示例4: test_huge_second_addr

    def test_huge_second_addr(self):
        st = u"""וכן הוא בב"ר (ילקוט שמעוני אסתר א, תתרמו) א"ר לוי בגדי כהונה"""
        ref = library.get_refs_in_string(st)[0]
        assert ref.sections[0] == 1
        assert len(ref.sections) == 1

        ''' These only work in the js
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:7,代码来源:library_test.py


示例5: test_inner_parenthesis

    def test_inner_parenthesis(self):

        ref = library.get_refs_in_string(u"Bereishit Rabbah (55:7)", "en")
        assert 1 == len(ref)
        assert ref[0] == Ref(u'Bereshit Rabbah 55:7')

        ''' Ranges not yet supported
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:7,代码来源:library_test.py


示例6: test_double_talmud

 def test_double_talmud(self):
     """ includes  ב''ק - why would that work?"""
     # ref = lib.get_refs_in_string(texts['2talmud'])
     # assert 2 == len(ref)
     """ includes  ב"ק """
     ref = library.get_refs_in_string(texts["bk-abbrev"])
     assert 2 == len(ref)
开发者ID:digideskio,项目名称:Sefaria-Project,代码行数:7,代码来源:library_test.py


示例7: test_double_talmud

 def test_double_talmud(self):
     ''' includes  ב''ק - why would that work?'''
     #ref = lib.get_refs_in_string(texts['2talmud'])
     #assert 2 == len(ref)
     ''' includes  ב"ק '''
     ref = library.get_refs_in_string(texts['bk-abbrev'])
     assert 2 == len(ref)
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:7,代码来源:library_test.py


示例8: test_inner_parenthesis

    def test_inner_parenthesis(self):

        ref = library.get_refs_in_string(u"Bereishit Rabbah (55:7)", "en")
        assert 1 == len(ref)
        assert ref[0] == Ref(u'Bereshit Rabbah 55:7')

        ''' These only work in the js
        ref = library.get_refs_in_string(u'במסכת שבועות (ל, ע"א) - כיצד אפוא', "he")
        assert 1 == len(ref)
        assert ref[0] == Ref(u'Shavuot 30a')

        ref = library.get_refs_in_string(u"במשנה, מסכת נדה (פרק ו, משנה ד), נקבע", "he")
        assert 1 == len(ref)
        assert ref[0] == Ref(u'Mishnah Nidah 6:4')
        '''
        ''' Ranges not yet supported
开发者ID:gisrael,项目名称:Sefaria-Project,代码行数:16,代码来源:library_test.py


示例9: test_positions

 def test_positions(self):
     for a in ['he_bible_mid', 'he_bible_begin', 'he_bible_end']:
         ref = library.get_refs_in_string(texts[a])
         assert 1 == len(ref)
         assert ref[0] == Ref(u"שמות כא, ד")
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:5,代码来源:library_test.py


示例10: test_false_positive

 def test_false_positive(self):
     ref = library.get_refs_in_string(texts['false_pos'])
     assert 1 == len(ref)
     assert ref[0] == Ref(u"דברים טז, יח")
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:4,代码来源:library_test.py


示例11: test_with_lead

 def test_with_lead(self):
     ref = library.get_refs_in_string(texts["2with_lead"])
     assert 2 == len(ref)
     assert {Ref(u"דברים ד,ח"), Ref(u"דברים ד,ז")} == set(ref)
开发者ID:digideskio,项目名称:Sefaria-Project,代码行数:4,代码来源:library_test.py


示例12: test_sefer_mitzvot

 def test_sefer_mitzvot(self):
     ref = library.get_refs_in_string(texts["neg327"])
     assert 4 == len(ref)
     assert {Ref(u"ויקרא טז,כט"), Ref(u"ויקרא כג,כח"), Ref(u"ויקרא כג,לא"), Ref(u"במדבר כט,ז")} == set(ref)
开发者ID:digideskio,项目名称:Sefaria-Project,代码行数:4,代码来源:library_test.py


示例13: test_three_digit_chapter

 def test_three_digit_chapter(self):
     ref = library.get_refs_in_string(texts['3dig'])
     assert 1 == len(ref)
     assert Ref(u'תהילים קי"ט') == ref[0]
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:4,代码来源:library_test.py


示例14: test_multiple

 def test_multiple(self):
     ref = library.get_refs_in_string(texts['2ref'])
     assert 2 == len(ref)
     assert {Ref('Brachot 7b'), Ref('Isaiah 12:13')} == set(library.get_refs_in_string(texts['2ref']))
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:4,代码来源:library_test.py


示例15: test_double_ref

 def test_double_ref(self):
     ref = library.get_refs_in_string(texts['he_2ref'])
     assert 2 == len(ref)
     assert {Ref(u'הושע ט ג'), Ref(u'דברי הימים ב לב יט')} == set(ref)
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:4,代码来源:library_test.py


示例16: test_out_of_brackets

 def test_out_of_brackets(self):
     ref = library.get_refs_in_string(texts['ignored_middle'])
     assert 2 == len(ref)
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:3,代码来源:library_test.py


示例17: test_spelled_mishnah

 def test_spelled_mishnah(self):
     ref = library.get_refs_in_string(u'דתנן (טהרות פ"ג משנה ב) רמ אומר')
     assert 1 == len(ref)
     assert ref[0] == Ref(u'טהרות פ"ג משנה ב')
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:4,代码来源:library_test.py


示例18: test_double_quote_talmud

 def test_double_quote_talmud(self):
     ref = library.get_refs_in_string(texts['dq_talmud'])
     assert 1 == len(ref)
     assert Ref(u'יבמות ס"ה') == ref[0]
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:4,代码来源:library_test.py


示例19: test_divrei_hayamim

 def test_divrei_hayamim(self):
     ref = library.get_refs_in_string(u"(דברי הימים ב לב, יט)")
     assert 1 == len(ref)
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:3,代码来源:library_test.py


示例20: test_bare_digits

 def test_bare_digits(self):
     assert set() == set(library.get_refs_in_string(texts['barenum'])) # Fixed in 5a4b813819ef652def8360da2ac1b7539896c732
开发者ID:cdesqaz,项目名称:Sefaria-Project,代码行数:2,代码来源:library_test.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python segno.make_qr函数代码示例发布时间:2022-05-27
下一篇:
Python schema.JaggedArrayNode类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap