コード例 #1
0
def link_tiferet_shmuel1(parsed_text, part):
    shmuellinks = []
    count = 0
    file = complex_tiferet_shmuel.open_file(record="chamudot", part=part)
    parsed = complex_tiferet_shmuel.parse(file)
    clean = complex_tiferet_shmuel.clean(parsed)
    complex_tiferet_shmuel.save_parsed_text(clean,
                                            record="chamudot",
                                            part=part)
    complex_tiferet_shmuel.run_post_to_api(record="chamudot", part=part)
    for k, perek in enumerate(parsed_text):
        for j, siman in enumerate(perek):
            #if re.match('\(.\)', siman):
            if ur'(*)' in siman:
                #print ur"הגעתי לכאן!"
                a = re.findall('\(\*\)', siman)
                part = re.sub("_", " ", part.strip())
                for b in a:
                    #print siman
                    count += 1
                    roash = "Rosh on %s, " % masechet + part + "." + str(
                        k + 1) + "." + str(j + 1)
                    shmuel = "Divrey Chamudot on " + masechet + "," + " " + part + "." + str(
                        count)
                    shmuellinks.append(link(roash, shmuel))
コード例 #2
0
def link_tiferet_shmuel1(parsed_text, part):
    shmuellinks = []
    count = 0
    file = complex_tiferet_shmuel.open_file(record = "chamudot",part=part)
    parsed = complex_tiferet_shmuel.parse(file)
    clean = complex_tiferet_shmuel.clean(parsed)
    complex_tiferet_shmuel.save_parsed_text(clean,record = "chamudot", part=part)
    complex_tiferet_shmuel.run_post_to_api(record = "chamudot", part=part)
    for k, perek in enumerate(parsed_text):
            for j, siman in enumerate(perek):
                #if re.match('\(.\)', siman):
                 if ur'(*)' in siman:
                    #print ur"הגעתי לכאן!"
                    a = re.findall('\(\*\)', siman)
                    part = re.sub("_"," ",part.strip())
                    for b in a:
                        #print siman
                        count +=1
                        roash = "Rosh on %s, " % masechet + part + "." + str(k+1) +  "." + str(j+1)
                        shmuel = "Divrey Chamudot on " + masechet + "," + " " + part +  "." + str(count)
                        shmuellinks.append(link(roash, shmuel))
コード例 #3
0
def link_tiferet_shmuel(parsed_text):
    shmuellinks = []
    count = 0
    file = complex_tiferet_shmuel.open_file(record = "chamudot")
    parsed = complex_tiferet_shmuel.parse(file)
    cleantext = complex_tiferet_shmuel.clean(parsed)
    complex_tiferet_shmuel.book_record(record = "chamudot")
    complex_tiferet_shmuel.save_parsed_text(cleantext, record = "chamudot")
    complex_tiferet_shmuel.run_post_to_api(record = "chamudot")
    for k, perek in enumerate(parsed_text):
        for i, seif in enumerate(perek):
            for j, siman in enumerate(seif):
                #if re.match('\(.\)', siman):
                 if ur'(*)' in siman:
                    #print ur"הגעתי לכאן!"
                    a = re.findall('\(\*\)', siman)
                    for b in a:
                        #print siman
                        count +=1
                        roash = "Rosh on %s." % masechet + str(k+1) + "." + str(i+1) + "." + str(j+1)
                        shmuel = "Divrey Chamudot on " + masechet + "." + str(count)
                        shmuellinks.append(link(roash, shmuel))
コード例 #4
0
def link_tiferet_shmuel(parsed_text):
    shmuellinks = []
    count = 0
    file = complex_tiferet_shmuel.open_file(record="chamudot")
    parsed = complex_tiferet_shmuel.parse(file)
    cleantext = complex_tiferet_shmuel.clean(parsed)
    complex_tiferet_shmuel.book_record(record="chamudot")
    complex_tiferet_shmuel.save_parsed_text(cleantext, record="chamudot")
    complex_tiferet_shmuel.run_post_to_api(record="chamudot")
    for k, perek in enumerate(parsed_text):
        for i, seif in enumerate(perek):
            for j, siman in enumerate(seif):
                #if re.match('\(.\)', siman):
                if ur'(*)' in siman:
                    #print ur"הגעתי לכאן!"
                    a = re.findall('\(\*\)', siman)
                    for b in a:
                        #print siman
                        count += 1
                        roash = "Rosh on %s." % masechet + str(
                            k + 1) + "." + str(i + 1) + "." + str(j + 1)
                        shmuel = "Divrey Chamudot on " + masechet + "." + str(
                            count)
                        shmuellinks.append(link(roash, shmuel))