Skip to content

Commit

Permalink
Scrappy little script looking for ocr derp
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Smith committed Jan 23, 2015
1 parent 3a234d9 commit ab4a12c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions misc/derp-sentinel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python

import tradedb
tdb = tradedb.TradeDB()

names = set()

for sys in tdb.systemByID.values():
for stn in sys.stations:
names.add(stn.name().upper())

mutators = {
'D': [ 'O', '0' ],
'W': [ 'VV' ],
}

def mutate(text, pos):
for i in range(pos, len(text)):
char = text[i]
if char not in mutators:
continue
yield from mutate(text, i+1)
for mutant in mutators[char]:
t2 = text[:i] + mutant + text[i+1:]
yield from mutate(t2, i+1)
yield t2

for name in names:
for mutant in mutate(name, 0):
if mutant in names:
print("{} <-> {}".format(name, mutant))

0 comments on commit ab4a12c

Please sign in to comment.