コード例 #1
0
def link_quran_kafi():
    quran = load_chapter("/books/complete/quran")
    kafi = load_chapter("/books/complete/al-kafi")

    process_chapter(quran, kafi)

    insert_chapter(kafi)
    insert_chapter(quran)
    write_file("/books/complete/al-kafi", jsonable_encoder(kafi))
    write_file("/books/complete/quran", jsonable_encoder(quran))
コード例 #2
0
def main():
    quran = load_chapter("/books/complete/quran")
    kafi = load_chapter("/books/complete/al-kafi")
    results = query_book(quran, kafi['chapters'][0]['chapters'][3])

    with open("kitab_hujjat_verses.csv", 'w', newline='',
              encoding='utf-8') as f:
        cw = csv.writer(f,
                        delimiter=',',
                        quotechar='"',
                        quoting=csv.QUOTE_MINIMAL)
        for result in results:
            cw.writerow(result)
コード例 #3
0
def kafi_narrators():
    # reset narrators
    delete_file("/people/narrators/index")
    narrator_index = load_narrator_index()
    narrators = {}

    kafi = load_chapter("/books/complete/al-kafi")
    process_chapter(kafi, narrator_index, narrators)

    insert_narrators(narrators)
    insert_narrator_index(narrator_index)
    insert_chapter(kafi)
コード例 #4
0
def add_kafi_sarwar():
    kafi = load_chapter("/books/complete/al-kafi")
    add_content(kafi.chapters[0], get_path("chapter\\1\\"))
    add_content(kafi.chapters[1], get_path("chapter\\2\\"))
    add_content(kafi.chapters[2], get_path("chapter\\3\\"))
    add_content(kafi.chapters[3], get_path("chapter\\4\\"))
    add_content(kafi.chapters[4], get_path("chapter\\5\\"))
    add_content(kafi.chapters[5], get_path("chapter\\6\\"))
    add_content(kafi.chapters[6], get_path("chapter\\7\\"))
    add_content(kafi.chapters[7], get_path("chapter\\8\\"))

    set_index(kafi, [0, 0, 0, 0], 0)
    insert_chapter(kafi)
    write_file("/books/complete/al-kafi", jsonable_encoder(kafi))

    pprint(SEQUENCE_ERRORS, width=240)
コード例 #5
0
def main():
	kafi = load_chapter("/books/complete/al-kafi")
	result = kafi.chapters[7].chapters[0].chapters[12].verses[0]
	text = SPAN_PATTERN.sub("", result.text[0])

	print(text)
コード例 #6
0
def main():
    kafi = load_chapter("/books/complete/al-kafi")
    results = query_book(kafi)