def tearDown(self):
     job = Index().load({"title": "Pele Yoetz"})
     job.nodes.title_group.titles = [variant for variant in job.nodes.title_group.titles if variant["text"] != "Boj"]
     job.save()
     IndexSet({"title": "Book of Bad Index"}).delete()
     IndexSet({"title": "Reb Rabbit"}).delete()
     IndexSet({"title": "Book of Variants"}).delete()
 def __init__(self, index_obj: model.Index):
     self._text_map = {}
     self.version_state = index_obj.versionState()
     leaf_nodes = index_obj.nodes.get_leaf_nodes()
     for leaf in leaf_nodes:
         oref = leaf.ref()
         en_chunk, he_chunk = oref.text('en'), oref.text('he')
         self._text_map[leaf.full_title()] = {
             'en_chunk': en_chunk,
             'he_chunk': he_chunk,
             'en_ja': en_chunk.ja(),
             'he_ja': he_chunk.ja()
         }
Exemple #3
0
    ("Abraham Cohen", u"אברהם כהן"),
    "Daf Shevui to Ketubot": ("Daf Shevui", u"דף שבועי"),
    "Daf Shevui to Megillah": ("Daf Shevui", u"דף שבועי"),
    "Footnotes to Kohelet by Bruce Heitler":
    ("Bruce Heitler", u"אBruce Heitler"),
    "Daf Shevui to Sukkah": ("Daf Shevui", u"דף שבועי"),
    #"Redeeming Relevance; Exodus": ("Francis Nataf", u"אFrancis Nataf"),
    #"Redeeming Relevance; Numbers": ("Francis Nataf", u"אFrancis Nataf"),
    #"Care of the Critically Ill", ),
    "Daf Shevui to Avodah Zarah": ("Daf Shevui", u"דף שבועי"),
    #"Redeeming Relevance; Deuteronomy":  ("Francis Nataf", u"אFrancis Nataf"),
    #"Kol HaTor", ),
    "A New Israeli Commentary on Pirkei Avot":
    ("Avigdor Shinan", u"אביגדור שנאן"),
    #"Redeeming Relevance; Genesis": ("Francis Nataf", u"אFrancis Nataf"),
}

for (title, names) in titles.iteritems():
    term = Term().load({"name": names[0]})
    if not term:
        print "adding term for " + names[0]
        term = Term()
        term.name = names[0]
        term.add_primary_titles(names[0], names[1])
        term.save()

    i = Index().load({"title": title})
    i.dependence = "Commentary"
    i.collective_title = names[0]
    i.save()
    print "Index updated for " + title
	#"Redeeming Relevance",
	"Abraham Cohen Footnotes to the English Translation of Masechet Berakhot": ("Abraham Cohen", u"אברהם כהן"),
	"Daf Shevui to Ketubot": ("Daf Shevui", u"דף שבועי"),
	"Daf Shevui to Megillah": ("Daf Shevui", u"דף שבועי"),
	"Footnotes to Kohelet by Bruce Heitler": ("Bruce Heitler", u"אBruce Heitler"),
	"Daf Shevui to Sukkah": ("Daf Shevui", u"דף שבועי"),
	#"Redeeming Relevance; Exodus": ("Francis Nataf", u"אFrancis Nataf"),
	#"Redeeming Relevance; Numbers": ("Francis Nataf", u"אFrancis Nataf"),
	#"Care of the Critically Ill", ),
	"Daf Shevui to Avodah Zarah": ("Daf Shevui", u"דף שבועי"),
	#"Redeeming Relevance; Deuteronomy":  ("Francis Nataf", u"אFrancis Nataf"),
	#"Kol HaTor", ),
	"A New Israeli Commentary on Pirkei Avot": ("Avigdor Shinan", u"אביגדור שנאן"),
	#"Redeeming Relevance; Genesis": ("Francis Nataf", u"אFrancis Nataf"),
}

for (title, names) in titles.iteritems():
	term = Term().load({"name": names[0]})
	if not term:
		print "adding term for " + names[0]
		term = Term()
		term.name = names[0]
		term.add_primary_titles(names[0], names[1]) 
		term.save()

	i = Index().load({"title": title})
	i.dependence = "Commentary"
	i.collective_title = names[0]
	i.save()
	print "Index updated for " + title
Exemple #5
0
 def tearDown(self):
     job = Index().load({"title": "Job"})
     job.titleVariants = [variant for variant in job.titleVariants if variant != "Boj"]
     job.save()
     IndexSet({"title": "Book of Bad Index"}).delete()
     IndexSet({"title": "Reb Rabbit"}).delete()