From 9a8c275822dd340ef8d64767f39fa416eaaa8e22 Mon Sep 17 00:00:00 2001 From: Katherine A Miller Date: Fri, 9 Nov 2018 22:42:48 -0500 Subject: [PATCH] Update error correction --- .gitignore/error correction | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitignore/error correction b/.gitignore/error correction index 4d67fe9..3dc24ae 100644 --- a/.gitignore/error correction +++ b/.gitignore/error correction @@ -163,3 +163,22 @@ def stripFrames(frames): (payload, parityColumn, parityRow) = splitFrame(frame) newFrames.append(payload) return newFrames + +def bin2string(frame, fill): + """ takes an 8x8 frame and fill and returns the string ecoded by the frame""" + string = [] + for n in frame: + char = e.bin2char(n) + if char != fill: + string.append(char) + string = ''.join(string) + return string + +def frames2string(frames, fill): + """iterates over each frame in a list of frames and returns the strings encoded by the frames""" + newStrings = [] + for frame in frames: + s1 = bin2string(frame, fill) + newStrings.append(s1) + newStrings = ''.join(newStrings) + return newStrings