def spilt_list_context_front_level(input_list): output_list = [] for value in input_list: if Type.is_str(value) or Type.is_int(value): output_list.append(spilt_str(value)) else: output_list.append(value) return output_list
def spilt_list_context_all_level(input_list): output_list = [] for value in input_list: if Type.is_str(value) or Type.is_int(value): output_list.append(spilt_str(value)) elif Type.is_list(value): output_list.append(value) else: SystemMessage.error(21102) return output_list
def spaceline_remove(input_list): output_list = [] if not Type.is_list(input_list): SystemMessage.error(2110401) if len(input_list) == 0: SystemMessage.error(2110402) for line in input_list: if Type.is_list(line): output_list.append(spaceline_remove(line)) if not Type.is_str(line) and not Type.is_int(line): SystemMessage.error(2110403) line = spilt_str(line) if line != '' and line != '\n': output_list.append(line) return output_list
def cut(input_list): if not Type.is_list(input_list): SystemMessage.error(3010101) output_list = [] for eachline in input_list: eachline_cut = jieba.cut(eachline) eachline_cut = ListCleaner.spilt_list_context_all_level(eachline_cut) output_list.append(eachline_cut) return output_list
def info(message): if not Type.is_str(message): error(990101) print( '------------------------------------------------------------------------------' ) print(Time.current_time_string()) print('提示:') print(message) print( '------------------------------------------------------------------------------' )
def spilt_str(input_context): if Type.is_int(input_context): input_context = str(input_context) if not Type.is_str(input_context): SystemMessage.error(21101) return input_context.strip()
def path_empty_check(str): if SystemType.is_empty_str(str): return True return False
def path_type_check(str): if SystemType.is_str(str): return True return False
def context_check(context): if not VarietyType.is_str(context) and not VarietyType.is_int(context): return False return True