-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
259 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
# Original by Dirk Wilhelm | ||
|
||
import csvexport | ||
import difflib | ||
import re | ||
import sys | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/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', ], | ||
'R': [ 'IT' ], | ||
} | ||
|
||
def mutate(text, pos): | ||
for i in range(pos, len(text)): | ||
char = text[i] | ||
if char not in mutators: | ||
continue | ||
bef, aft = text[:i], text[i+1:] | ||
for mutant in mutators[char]: | ||
t2 = bef + mutant + aft | ||
yield t2 | ||
yield from mutate(str(t2), i+len(mutant)) | ||
|
||
for name in names: | ||
for mutant in mutate(name, 0): | ||
if mutant in names: | ||
print("{} <-> {}".format(name, mutant)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters