예제 #1
0
파일: run.py 프로젝트: madlib/testsuite
def dict_by_dict(r, dict, table):
    total_words = []
    for key, value in dict.iteritems():
        total_words += utility.get_file_words(value.split('\n'))
    dict = utility.unique(total_words)
    utility.write_dict_file(dict, table + '.dict')
    return dict
예제 #2
0
파일: run.py 프로젝트: Liuzeng/testsuite
def dict_by_dict(r, dict, table):
    total_words = []
    for key, value in dict.iteritems():
        total_words += utility.get_file_words(value.split('\n'))
    dict = utility.unique(total_words)
    utility.write_dict_file(dict, table + '.dict')
    return dict
예제 #3
0
파일: run.py 프로젝트: madlib/testsuite
def dict_by_file(r, table, parse_method=None):
    file_path_list, file_name_list = utility.get_file_list(r)
    total_words = []
    for file_path in file_path_list:
        if file_path.startswith('all'):
            total_words += open(file_path, 'r').readlines()
    dict = utility.unique(total_words)
    utility.write_dict_file(dict, r.split('/')[-1] + '.dict')
    return dict
예제 #4
0
파일: run.py 프로젝트: madlib/testsuite
def dict_by_text(r, table, parse_method=None):
    file_path_list, file_name_list = utility.get_file_list(r)
    total_words = []
    for file_path in file_path_list:
        lines = parse_method(file_path)
        total_words += utility.get_file_words(lines)
    dict = utility.unique(total_words)
    utility.write_dict_file(dict, table + '.dict')
    return dict
예제 #5
0
파일: run.py 프로젝트: Liuzeng/testsuite
def dict_by_file(r, table, parse_method = None):
    file_path_list, file_name_list = utility.get_file_list(r)
    total_words = []
    for file_path in file_path_list:
        if file_path.startswith('all'):
            total_words += open(file_path, 'r').readlines()
    dict = utility.unique(total_words)
    utility.write_dict_file(dict, r.split('/')[-1] + '.dict')
    return dict
예제 #6
0
파일: run.py 프로젝트: Liuzeng/testsuite
def dict_by_text(r, table, parse_method = None):
    file_path_list, file_name_list = utility.get_file_list(r)
    total_words = []
    for file_path in file_path_list:
        lines = parse_method(file_path)
        total_words += utility.get_file_words(lines)
    dict = utility.unique(total_words)
    utility.write_dict_file(dict, table + '.dict')
    return dict