Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
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