Skip to content

Commit

Permalink
Add a tool to fix common mistakes.
Browse files Browse the repository at this point in the history
For example, '.' is often substituted with 'N'.
  • Loading branch information
ali1234 committed Aug 19, 2011
1 parent c682eca commit 149b86d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions fixup.py
@@ -0,0 +1,32 @@
#!/usr/bin/env python

# * Copyright 2011 Alistair Buxton <a.j.buxton@gmail.com>
# *
# * License: This program is free software; you can redistribute it and/or
# * modify it under the terms of the GNU General Public License as published
# * by the Free Software Foundation; either version 3 of the License, or (at
# * your option) any later version. This program is distributed in the hope
# * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# * GNU General Public License for more details.

# This fixes common errors made by the deconvolution process.

import sys

if __name__ == '__main__':

try:
while True:
packet = [x for x in sys.stdin.read(42)]
for i in range(1,42):
if packet[i] == 'N' and packet[i-1].islower():
packet[i] = '.'
sys.stdout.write("".join(packet))
sys.stdout.flush()


except IOError:
exit(0)


0 comments on commit 149b86d

Please sign in to comment.