예제 #1
0
def make_eq(q, a, VERBOSE, TRAIN):
    #wps = open(q).readlines()
    #answs = open(a).readlines()
    #VERBOSE=True
    wps = q

    for k in range(len(wps)):
        if VERBOSE:
            for i in range(len(wps)):
                print(i, wps[i])
            k = int(input())
        print(k)
        #First preprocessing, tokenize slightly
        problem = utils.preprocess_problem(wps[k])
        print(problem)

        story = utils.parse_stanford_nlp(problem)
        sets = makesets.makesets(story['sentences'])
        EF.main(sets, k, a[k], sys.argv[1])
        sets = [x for x in sets
                if makesets.floatcheck(x[1].num)
                or x[1].num == 'x']
        print(sets)
        for z in sets:
            z[1].details()
예제 #2
0
def make_eq(q, a, VERBOSE, TRAIN):
    #wps = open(q).readlines()
    #answs = open(a).readlines()
    #VERBOSE=True
    wps = q

    for k in range(len(wps)):
        if VERBOSE:
            for i in range(len(wps)):
                print(i, wps[i])
            k = int(input())
        print(k)
        #First preprocessing, tokenize slightly
        problem = utils.preprocess_problem(wps[k])
        print(problem)

        story = utils.parse_stanford_nlp(problem)
        sets = makesets.makesets(story['sentences'])
        EF.main(sets, k, a[k], sys.argv[1])
        sets = [
            x for x in sets if makesets.floatcheck(x[1].num) or x[1].num == 'x'
        ]
        print(sets)
        for z in sets:
            z[1].details()
예제 #3
0
def make_eq(q, a, VERBOSE, TRAIN):
    wps = q

    for k in range(len(wps)):
        if VERBOSE:
            for i in range(len(wps)):
                print(i, wps[i])
            k = int(input())
        print(k)
        #First preprocessing, tokenize slightly
        problem = utils.preprocess_problem(wps[k])
        print(problem)

        story = utils.parse_stanford_nlp(problem)
        with open("s_data/" + str(k) + ".pickle", 'wb') as f:
            pickle.dump(story, f)
예제 #4
0
    return sets


def bug():
    print("bug")
    ip = 0
    while ip == 0:
        inp = input()
        if inp == 0:
            ip = 1
        else:
            exec(inp)


if __name__ == "__main__":
    q, a, e = utils.parse_inp(sys.argv[1])
    wps = q
    while True:
        for i in range(len(q)):
            print(i, q[i])
        k = input()
        k = int(k)
        problem = wps[k].lower()
        print(problem)
        story = utils.parse_stanford_nlp(problem)
        sets = makesets(story["sentences"])
        for s in sets:
            s[1].details()
        input()
예제 #5
0
    return sets


def bug():
    print("bug")
    ip = 0
    while ip == 0:
        inp = input()
        if inp == 0:
            ip = 1
        else:
            exec(inp)


if __name__ == "__main__":
    q, a, e = utils.parse_inp(sys.argv[1])
    wps = q
    while True:
        for i in range(len(q)):
            print(i, q[i])
        k = input()
        k = int(k)
        problem = wps[k].lower()
        print(problem)
        story = utils.parse_stanford_nlp(problem)
        sets = makesets(story["sentences"])
        for s in sets:
            s[1].details()
        input()