Ejemplo n.º 1
0
def playbill_windows_out(files):
    test = input("Run Playbill Windows Test Y/N?: ")
    if test == "Y" or test == "y":
        anchor = input("Please enter anchor term: ")
        context = input("Please enter context term: ")
        master = []
        for i in files:
            matrix = ocr_search.location(i)
            results = ocr_search.playbill_windows(anchor, context, matrix)
            results[0].append(i)
            results = ocr_search.csv_results("Playbill", results)
            master.append(results)
        return master
    else:
        return False
Ejemplo n.º 2
0
def line_windows_out(files):
    test = input("Run Line Windows Test Y/N?: ")
    if test == "Y" or test == "y":
        anchor = input("Please enter anchor term: ")
        context = input("Please enter context term: ")
        n = int(
            input("Please enter the number of lines to test before and\
 after anchor: "))
        master = []
        for i in files:
            matrix = ocr_search.location(i)
            results = ocr_search.line_windows(anchor, context, n, matrix)
            results[0].append(i)
            results = ocr_search.csv_results("Line", results)
            master.append(results)
        return master
    else:
        return False
Ejemplo n.º 3
0
def char_windows_out(files):
    test = input("Run Character Windows Test Y/N?: ")
    if test == "Y" or test == "y":
        anchor = input("Please enter anchor term: ")
        context = input("Please enter context term: ")
        n = int(
            input("Please enter the number of characters to search before\
/after the anchor term: "))
        master = []
        for i in files:
            matrix = ocr_search.location(i)
            results = ocr_search.character_windows(anchor, context, n, matrix)
            results[0].append(i)
            results = ocr_search.csv_results("Character", results)
            master.append(results)
        return master
    else:
        return False
Ejemplo n.º 4
0
def loc_search_out(files):
    test = input("Run Location Search Test Y/N?: ")
    if test == "Y" or test == "y":
        anchor = input("Please enter anchor term: ")
        context = input("Please enter context term: ")
        index = input("Please enter where you would like to start your \
location search (enter 0 to start from the beginning or leave blank \
to use the anchor word as an index): ")
        if index != "":
            index = int(index)
        percent = float(
            input("Please enter what percentage of the playbill\
 you would like to search: "))
        master = []
        for i in files:
            matrix = ocr_search.location(i)
            results = ocr_search.location_search(anchor, context, index,
                                                 percent, matrix)
            results[0].append(i)
            results = ocr_search.csv_results("Location", results)
            master.append(results)
        return master
    else:
        return False