这是Python代码:
def get_symbols(file_name): with open(file_name, "r") as in_file: records = [] count = 0 symbol_set = "" for line in in_file: symbol_set = symbol_set + line[:-1] + ',' count = count + 1 if count % 50 == 0: records.append(symbol_set) symbol_set = "" symbols.append(symbol_set) return records
这是Java代码:
ListgetSymbols(String filename) throws IOException { Listrecords = new ArrayList