def generate(): frameObjects = [] #for holding the frame objects symbol_objects = symbol_generation.generateSymbols() #start with the first id id = 0 for frame in frames: #for all of the frames lastData = None newData = [] save_id = None id_symbol = [symbol for symbol in symbol_objects if symbol.value == id][0] for data in frame: #for the data in each frame if lastData is not None: if lastData.name == data: lastData.symbol_length += 1 else: newData.append(lastData) lastData = block(name=data,symbol_length=1) else: lastData = block(name=data,symbol_length=1) newData.append(lastData) frameObjects.append(symbol_frame(identifier=id_symbol,blocks=newData)) id += 1 return frameObjects
def generate(): frameObjects = [] #for holding the frame objects symbol_objects = symbol_generation.generateSymbols() #start with the first id id = 0 for frame in frames: #for all of the frames lastData = None newData = [] save_id = None id_symbol = [ symbol for symbol in symbol_objects if symbol.value == id ][0] for data in frame: #for the data in each frame if lastData is not None: if lastData.name == data: lastData.symbol_length += 1 else: newData.append(lastData) lastData = block(name=data, symbol_length=1) else: lastData = block(name=data, symbol_length=1) newData.append(lastData) frameObjects.append(symbol_frame(identifier=id_symbol, blocks=newData)) id += 1 return frameObjects
def generate(): frameObjects = [] #for holding the frame objects symbol_objects = symbol_generation.generateSymbols() id = 0 for frame in frames: #for all of the frames lastData = None newData = [] save_id = None for symbol in symbol_objects: if symbol.value == id: save_id = symbol break for data in frame: #for the data in each frame if lastData is not None: if lastData.name == data: lastData.symbolLength += 1 else: newData.append(lastData) lastData = block(name=data,symbolLength=1) else: lastData = block(name=data,symbolLength=1) newData.append(lastData) frameObjects.append(symbol_frame(identifier=save_id,blocks=newData)) id += 1 return frameObjects