Skip to content

Commit

Permalink
Improved derp defence
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Jan 25, 2015
1 parent cb7f87a commit 7800ddf
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 83 deletions.
113 changes: 61 additions & 52 deletions cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,67 @@
re.IGNORECASE + re.VERBOSE)


ocrDerp = re.compile(r'''(
LAN[O0]ING |
[O0][O0]CK |
[O0]INEILL |
AQUIRE[O0] |
[O0](UTT|ALT)[O0]N |
8RA[DO0]LEY |
BRA[O0]LEY |
LLOY[O0] |
[O0]RBDAL |
DRB[O0]DAL |
[D0]RBITAL |
REE[O0] |
\BDOCK\b |
\BTERMINAL\b |
\bKID?[O0] |
\b[O3]E\b |
\bANDRA[O3]E\b |
\bAN[O3]RADE\b |
\bAN[O3]RA[O3]E\b |
VVELL\b |
[O0]IRAC\b |
\bVV |
\b[O0]ER?\b |
\b[O0]RAKE |
HAR[O0]T\b |
\b[O0]ARK |
\b[O0]DAM |
[O0]EPOT |
\bMERE[O0] |
\b[O0]ENN?IS |
\bBRAN[o0] |
W[O0]{3} |
GO(D[O0]|[O0]D|[O0][O])ARD |
GO[DO0]{2}AR[O0] |
ORBRAL\b |
\bJOR[O0]A |
\bST[O0]ART |
\bQUIMPY |
\bVAR[O0]E |
EN[^T]?ERPRISE |
EN..ERPRISE |
\bMUR[O0]O |
\bBAR[O0]E |
\bBALLAR[O0] |
\b[O0]REYER\b |
\bEDWAR[O0] |
\bE[O0]WAR[DO0] |
III |
STARON\b |
\BHANG[EA]R$ |
^\S+HUB$ |
\bLEBEOEV |
\B(BASE|ENTE[RP]P[RP]ISE|TERMINA(L|II)|P(L|II)ANT|RELAY|ORITAL|PLATFORM|COLONY|VISION|REFINERY)$ |
\bBRIOGER |
\bJUOSON |
LANOER |
G[O0][O0]([RW]|VV)[O0I]N
)''', flags=re.X)


######################################################################
# Exception classes

Expand Down Expand Up @@ -297,58 +358,6 @@ def getItemByNameIndex(cur):
return { name: itemID for (itemID, name) in cur }


ocrDerp = re.compile(r'''(
LAN[O0]ING |
[O0][O0]CK |
[O0]INEILL |
AQUIRE[O0] |
[O0](UTT|ALT)[O0]N |
8RA[DO0]LEY |
BRA[O0]LEY |
LLOY[O0] |
[O0]RBDAL |
DRB[O0]DAL |
[D0]RBITAL |
REE[O0] |
\BDOCK\b |
\BTERMINAL\b |
\bKID?[O0] |
\b[O3]E\b |
\bANDRA[O3]E\b |
\bAN[O3]RADE\b |
\bAN[O3]RA[O3]E\b |
VVELL\b |
[O0]IRAC\b |
\bVV |
\b[O0]ER?\b |
\b[O0]RAKE |
HAR[O0]T\b |
\b[O0]ARK |
\b[O0]DAM |
[O0]EPOT |
\bMERE[O0] |
\b[O0]ENN?IS |
\bBRAN[o0] |
W[O0]{3} |
GO(D[O0]|[O0]D|[O0][O])ARD |
GO[DO0]{2}AR[O0] |
ORBRAL\b |
\bJOR[O0]A |
\bST[O0]ART |
\bQUIMPY |
\bVAR[O0]E |
EN[^T]?ERPRISE |
EN..ERPRISE |
\bMUR[O0]O |
\bBAR[O0]E |
\bBALLAR[O0] |
\b[O0]REYER\b |
\bEDWAR[O0] |
\bE[O0]WAR[DO0] |
III
)''', flags=re.X)


def checkForOcrDerp(tdenv, systemName, stationName):
if ocrDerp.search(stationName):
tdenv.NOTE(
Expand Down
60 changes: 31 additions & 29 deletions corrections.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,16 @@
DELETED = -111

systems = {
"22 LYNCIS": "PEPPER",
"ARGETLAMH": "ARGETLáMH",
"TAVYTERE": "ALRAI SECTOR ON-T B3-2",
"PANTAA CEZISA": "GEORGE PANTAZIS",
"DJALI": "HERCULIS SECTOR QD-T B3-4",
"22 LYNCIS": "PEPPER",
"PANTAA CEZISA": "GEORGE PANTAZIS",
"TAVYTERE": "ALRAI SECTOR ON-T B3-2",

#ADD_SYSTEMS_HERE
}

stations = {
"ANINOHANU/BAROEEN HANGER": DELETED,
"ANLAVE/SURIPARK" : DELETED,
"ARTEMIS/BURCKHAROT STATION": DELETED,
"BD-02 4304/BRANOENSTEIN ENTERPRISE": DELETED,
"ERLIK/REYNOLOS TERMINAL": DELETED,
"FUTHORC/ACQUIREO TASTE ORBITAL": DELETED,
"G 165-13/NAODODOUR PLATFORM": DELETED,
"HATMEHING/HEVEI.IUS TERMINAL": DELETED,
"HATMEHING/HEVEIIUS TERMINAL": DELETED,
"HIP 69913/KONORATYEV OUTPOST": DELETED,
"LHS 1453/SAAVEORA PORT": DELETED,
"LHS 3447/WORLIOGE TERMINAL": DELETED,
"LUGH/BALANOIN GATEWAY": DELETED,
"NARASIMHA/MENOEL SURVEY": DELETED,
"OSSITO/STOART MINES": DELETED,
"SORBAGO/CARROLLSURVEY": DELETED,
"THUNDERBIRD/QUIMPY PORT": DELETED,
"VEROANDI/VAROEMAN GATEWAY": DELETED,
"171 G. AQUARII/ELCANO OOCK": "Elcano Dock",
"21 DRACO/ROBERTS PORT": DELETED,
"37 XI BOOTIS/SCHIRRA PLANT": "Schirba Plant",
Expand All @@ -48,14 +30,18 @@
"AMAIT/LOPEZ DE VILLALOBOS": "Lopez De Villalobos Prospect",
"AMARAK/WERNER VON SIEMENS VISON": "Werner Von Siemens Vision",
"ANAPOS/HERSCHEL PLATFORM": "Herschel Plant",
"ANINOHANU/BAROEEN HANGER": DELETED,
"ANLAVE/KOBAYASHICRY": "Kobayashi City",
"ANLAVE/SURIPARK" : DELETED,
"AO QIN/CHAPMAN HUB": DELETED,
"APOYOTA/FLINTSTATION": "Flint Station",
"APOYOTA/HAHNRELAY": "Hahn Relay",
"ARTEMIS/BURCKHAROT STATION": DELETED,
"AULIN/ALUIN ENTERPIRSE": "Aulin Enterprise",
"BALDUR/DUTTON STATION": DELETED,
"BD+13 693/DRUMMOND`S PROGRESS": "Drummond's Progress",
"BD+65 1846/SHARGIN BEACON": DELETED,
"BD-02 4304/BRANOENSTEIN ENTERPRISE": DELETED,
"BD-02 4304/OURRANCE STATION": DELETED,
"BOLG/MOXONS MOJO": "Moxon's Mojo",
"CEMIESS/TITUS STATION": "Titius Station",
Expand All @@ -65,12 +51,19 @@
"DT VIRGINIS/CHUN STATION": "Chun Vision",
"EGOVAE/ENOATE MARKET": "Endate Market",
"EKONIR/MOREYVISION": "Morey Vision",
"ERLIK/REYNOLOS TERMINAL": DELETED,
"FROG/KEMPSTON HAROWICK": "KempstoN Hardwick",
"FUTHORC/ACQUIREO TASTE ORBITAL": DELETED,
"G 165-13/NAODODOUR PLATFORM": DELETED,
"GCRV 4654/HERZEFELD LANDING": "Herzfeld Landing",
"GROOMBRIDGE 1618/FRANKUN RING": "Franklin Ring",
"HATMEHING/HEVEI.IUS TERMINAL": DELETED,
"HATMEHING/HEVEIIUS TERMINAL": DELETED,
"HDS 1879/HEDIN ORBITAL": DELETED,
"HILLAUNGES/Argelanoer Port": DELETED,
"HIP 110483/VALIGURSKY ORBITAE": "Valigursky Orbital",
"HIP 4907/EDISON PLATFORM": DELETED,
"HIP 69913/KONORATYEV OUTPOST": DELETED,
"HR 5451/MACDONALO HUB": "MacDonald Hub",
"HR 5451/MACOONALD HUB": "MacDonald Hub",
"HR 5451/MACOONALO HUB": "MacDonald Hub",
Expand All @@ -79,9 +72,11 @@
"LEESTI/GEORGELUCAS": "George Lucas",
"LFT 1446/BOSCH SETTLEMENT": DELETED,
"LHS 1101/BONDAR CITY": DELETED,
"LHS 1453/SAAVEORA PORT": DELETED,
"LHS 220/CULPEPERCOLONY": "Culpeper Colony",
"LHS 250/KOVALESKY ENTERPRISE": "Kovalevsky Enterprise",
"LHS 2884/ABNETT PLATEFORM": "Abnett Platform",
"LHS 3447/WORLIOGE TERMINAL": DELETED,
"LHS 380/QURESHIORBRAL": DELETED,
"LHS 53/OCONNOR SETTLEMENT": "O'Connor Settlement",
"LHS 64/WIBERG HANGAR": "Wiberg Hanger", # "Hanger",
Expand All @@ -90,21 +85,25 @@
"LP 51-17/ARCHAMBAULT HORIZONS": DELETED,
"LP 811-17/STJEPAN SELJAN PORT": DELETED,
"LP 862-184/MAYR HANGAR": "Mayr Hanger",
"LTT 14437/BRIOGER BASE": DELETED,
"LTT 15449/REILLI DOCK": "Reilly Dock",
"LTT 16218/CHARGAFFPORT": "Chargaff Port",
"LTT 7548/ALEXANDRIA RINF": "Alexandria Ring",
"LTT 9455/OLEARY VISION": "O'Leary Vision",
"LUGH/BALANOIN GATEWAY": DELETED,
"MANNODAVA/ALIPORT": DELETED,
"MANNONA/THORNYCROFY PENAL COLONY": "Thornycroft Penal Colony",
"MCC 467/ROB HUBBARD RING": "Ron Hubbard Ring",
"MINJANGO/OENNING PLATFORM": "Denning Platform",
"MISISTURE/GELFANO DOCK": DELETED,
"MOKOSH/LUBEN ORBITAL": "Lubin Orbital",
"NARASIMHA/MENOEL SURVEY": DELETED,
"NLTT 49528/OCONNORLANQNG": "O'Connor Landing",
"NLTT 49528/O‹CONNOR LANDING": "O'Connor Landing",
"ONGKAMPAN/PATTERSON STATION: 274": "Patterson Station",
"OPALA/ZAMK PLATFORM": "Zamka Platform",
"ORERVE/WATSON SATION": "Watson Station",
"OSSITO/STOART MINES": DELETED,
"PANGLUYA/BRADBURYWORKS": "Bradbury Works",
"PERENDI/SHEPHERD INSTALLATION": DELETED,
"PRIVA/DUGAN OOCK": "Dugan Dock",
Expand All @@ -113,13 +112,15 @@
"RAHU/LEBEDEV BEACON": DELETED,
"RHO CANCRI/HAMILTON R,SERVE": "Hamilton Reserve",
"RHO CANCRI/HAMILTON R�SERVE": "Hamilton Reserve",
"SORBAGO/CARROLLSURVEY": DELETED,
"STEIN 2051/TREVITHICK PORT": DELETED,
"TAHA DERG/0URRANCE LANDING": DELETED,
"TANMARK/CASSI E-L-PEIA": DELETED,
"TARACH TOR/TRANQUEUTY": DELETED,
"TARACH TOR/TRANQUNLRY": DELETED,
"TARACH TOR/TRANQUWUTY": DELETED,
"TENG YEH/GARAN SURVERY": "Garan Survey",
"THUNDERBIRD/QUIMPY PORT": DELETED,
"TIETHAY/SANTOS PLANT1": DELETED,
"TRELLA/TITTO COLONY": "Tito Colony",
"TUAREG/KOPFF OOCK": "Kopff Dock",
Expand All @@ -130,6 +131,7 @@
"V989 CASSIOPEIAE/LOW WORKS": DELETED,
"VALDA/CLAIRAUT OOCK": "Clairaut Dock",
"VEQUESS/AGNEWS FOLLY": "Agnews' Folly",
"VEROANDI/VAROEMAN GATEWAY": DELETED,
"WOLF 1301/SAUNDER'S DIVE": "Saunders's Dive",
"WOLF 46/FISCHER CITY": "Fischer Station",
"YAKABUGAI/SEREBOV STATION": "Serebrov Station",
Expand All @@ -149,19 +151,19 @@
}

items = {
'HYDROGEN FUELS': 'Hydrogen Fuel',
'MARINE SUPPLIES': 'Marine Equipment',
'TERRAIN ENRICH SYS': 'Land Enrichment Systems',
'HEL-STATIC FURNACES': 'Microbial Furnaces',
'REACTIVE ARMOR': 'Reactive Armour',
'COTTON': DELETED,
'ALLOYS': DELETED,
'PLASTICS': DELETED,
'CENTAURI MEGA GIN': DELETED,
'CONSUMER TECH': 'Consumer Technology',
'COTTON': DELETED,
'DOM. APPLIANCES': 'Domestic Appliances',
'FRUIT AND VEGETABLES': 'Fruit And Vegetables',
'HEL-STATIC FURNACES': 'Microbial Furnaces',
'HYDROGEN FUELS': 'Hydrogen Fuel',
'MARINE SUPPLIES': 'Marine Equipment',
'NON-LETHAL WPNS': 'Non-Lethal Weapons',
'CENTAURI MEGA GIN': DELETED,
'PLASTICS': DELETED,
'REACTIVE ARMOR': 'Reactive Armour',
'TERRAIN ENRICH SYS': 'Land Enrichment Systems',

}

Expand Down
2 changes: 0 additions & 2 deletions data/Station.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2057,7 +2057,6 @@ unq:[email protected]_id,unq:name,ls_from_star,blackmarket,max_pad_size
'HILL PA HSI','Teng-Hui Gateway',53,'N','M'
'HILL PA HSI','Wisoff Terminal',106,'N','M'
'HILLAUNGES','Argelander Port',0,'?','?'
'HILLAUNGES','Argelanoer Port',0,'?','?'
'HIMANES','Ochoa Port',444,'N','L'
'HIP 10175','Lucretius Gateway',4850,'Y','L'
'HIP 10175','Stefanyshyn-Piper Station',4850,'Y','L'
Expand Down Expand Up @@ -3500,7 +3499,6 @@ unq:[email protected]_id,unq:name,ls_from_star,blackmarket,max_pad_size
'LTT 14436','Egan Plant',0,'?','?'
'LTT 14436','Galiano City',0,'?','?'
'LTT 14437','Bridger Base',581,'N','M'
'LTT 14437','Brioger Base',0,'?','?'
'LTT 1483','Hedin Gateway',2663,'?','L'
'LTT 14850','Franklin Vision',0,'?','?'
'LTT 15068','Grabe Station',277,'N','M'
Expand Down

0 comments on commit 7800ddf

Please sign in to comment.