Automatically disambiguate location identifiers

See the script docstring for what was done

Victory Roads and Halls of Origin should probably be hand-tuned later
This commit is contained in:
Petr Viktorin 2011-04-12 00:43:03 +03:00
parent 901c3a02bb
commit ae5225c932
2 changed files with 240 additions and 160 deletions

View file

@ -3,7 +3,7 @@ id,region_id,identifier
2,4,eterna-city 2,4,eterna-city
3,4,pastoria-city 3,4,pastoria-city
4,4,sunyshore-city 4,4,sunyshore-city
5,4,pokemon-league 5,4,sinnoh-pokemon-league
6,4,oreburgh-mine 6,4,oreburgh-mine
7,4,valley-windworks 7,4,valley-windworks
8,4,eterna-forest 8,4,eterna-forest
@ -11,7 +11,7 @@ id,region_id,identifier
10,4,mt-coronet 10,4,mt-coronet
11,4,great-marsh 11,4,great-marsh
12,4,solaceon-ruins 12,4,solaceon-ruins
13,4,victory-road 13,4,sinnoh-victory-road
14,4,ravaged-path 14,4,ravaged-path
15,4,oreburgh-gate 15,4,oreburgh-gate
16,4,stark-mountain 16,4,stark-mountain
@ -28,40 +28,40 @@ id,region_id,identifier
28,4,lake-acuity 28,4,lake-acuity
29,4,valor-lakefront 29,4,valor-lakefront
30,4,acuity-lakefront 30,4,acuity-lakefront
31,4,route-201 31,4,sinnoh-route-201
32,4,route-202 32,4,sinnoh-route-202
33,4,route-203 33,4,sinnoh-route-203
34,4,route-204 34,4,sinnoh-route-204
35,4,route-205 35,4,sinnoh-route-205
36,4,route-206 36,4,sinnoh-route-206
37,4,route-207 37,4,sinnoh-route-207
38,4,route-208 38,4,sinnoh-route-208
39,4,route-209 39,4,sinnoh-route-209
40,4,lost-tower 40,4,lost-tower
41,4,route-210 41,4,sinnoh-route-210
42,4,route-211 42,4,sinnoh-route-211
43,4,route-212 43,4,sinnoh-route-212
44,4,route-213 44,4,sinnoh-route-213
45,4,route-214 45,4,sinnoh-route-214
46,4,route-215 46,4,sinnoh-route-215
47,4,route-216 47,4,sinnoh-route-216
48,4,route-217 48,4,sinnoh-route-217
49,4,route-218 49,4,sinnoh-route-218
50,4,route-219 50,4,sinnoh-route-219
51,4,route-221 51,4,sinnoh-route-221
52,4,route-222 52,4,sinnoh-route-222
53,4,route-224 53,4,sinnoh-route-224
54,4,route-225 54,4,sinnoh-route-225
55,4,route-227 55,4,sinnoh-route-227
56,4,route-228 56,4,sinnoh-route-228
57,4,route-229 57,4,sinnoh-route-229
58,4,twinleaf-town 58,4,twinleaf-town
59,4,celestic-town 59,4,celestic-town
60,4,resort-area 60,4,resort-area
61,4,sea-route-220 61,4,sinnoh-sea-route-220
62,4,sea-route-223 62,4,sinnoh-sea-route-223
63,4,sea-route-226 63,4,sinnoh-sea-route-226
64,4,sea-route-230 64,4,sinnoh-sea-route-230
65,2,blackthorn-city 65,2,blackthorn-city
66,2,burned-tower 66,2,burned-tower
67,1,celadon-city 67,1,celadon-city
@ -85,53 +85,53 @@ id,region_id,identifier
85,2,olivine-city 85,2,olivine-city
86,1,pallet-town 86,1,pallet-town
87,1,rock-tunnel 87,1,rock-tunnel
88,1,route-1 88,1,kanto-route-1
89,1,route-10 89,1,kanto-route-10
90,1,route-11 90,1,kanto-route-11
91,1,route-12 91,1,kanto-route-12
92,1,route-13 92,1,kanto-route-13
93,1,route-14 93,1,kanto-route-14
94,1,route-15 94,1,kanto-route-15
95,1,route-16 95,1,kanto-route-16
96,1,route-17 96,1,kanto-route-17
97,1,route-18 97,1,kanto-route-18
98,1,sea-route-19 98,1,kanto-sea-route-19
99,1,route-2 99,1,kanto-route-2
100,1,sea-route-20 100,1,kanto-sea-route-20
101,1,sea-route-21 101,1,kanto-sea-route-21
102,1,route-22 102,1,kanto-route-22
103,1,route-24 103,1,kanto-route-24
104,1,route-25 104,1,kanto-route-25
105,1,route-26 105,1,kanto-route-26
106,1,route-27 106,1,kanto-route-27
107,1,route-28 107,1,kanto-route-28
108,2,route-29 108,2,johto-route-29
109,1,route-3 109,1,kanto-route-3
110,2,route-30 110,2,johto-route-30
111,2,route-31 111,2,johto-route-31
112,2,route-32 112,2,johto-route-32
113,2,route-33 113,2,johto-route-33
114,2,route-34 114,2,johto-route-34
115,2,route-35 115,2,johto-route-35
116,2,route-36 116,2,johto-route-36
117,2,route-37 117,2,johto-route-37
118,2,route-38 118,2,johto-route-38
119,2,route-39 119,2,johto-route-39
120,1,route-4 120,1,kanto-route-4
121,2,sea-route-40 121,2,johto-sea-route-40
122,2,sea-route-41 122,2,johto-sea-route-41
123,2,route-42 123,2,johto-route-42
124,2,route-43 124,2,johto-route-43
125,2,route-44 125,2,johto-route-44
126,2,route-45 126,2,johto-route-45
127,2,route-46 127,2,johto-route-46
128,2,route-47 128,2,johto-route-47
129,2,route-48 129,2,johto-route-48
130,1,route-5 130,1,kanto-route-5
131,1,route-6 131,1,kanto-route-6
132,1,route-7 132,1,kanto-route-7
133,1,route-8 133,1,kanto-route-8
134,1,route-9 134,1,kanto-route-9
135,2,ruins-of-alph 135,2,ruins-of-alph
136,1,seafoam-islands 136,1,seafoam-islands
137,2,slowpoke-well 137,2,slowpoke-well
@ -144,17 +144,17 @@ id,region_id,identifier
149,2,unknown-all-rattata 149,2,unknown-all-rattata
150,2,unknown-all-bugs 150,2,unknown-all-bugs
151,1,vermilion-city 151,1,vermilion-city
152,1,victory-road 152,1,kanto-victory-road-1
153,2,violet-city 153,2,violet-city
154,1,viridian-city 154,1,viridian-city
155,1,viridian-forest 155,1,viridian-forest
156,2,whirl-islands 156,2,whirl-islands
157,1,route-23 157,1,kanto-route-23
158,1,power-plant 158,1,power-plant
159,1,victory-road 159,1,kanto-victory-road-2
160,1,pokemon-tower 160,1,pokemon-tower
161,1,pokemon-mansion 161,1,pokemon-mansion
162,1,safari-zone 162,1,kanto-safari-zone
163,4,sandgem-town 163,4,sandgem-town
164,4,floaroma-town 164,4,floaroma-town
165,4,solaceon-town 165,4,solaceon-town
@ -178,8 +178,8 @@ id,region_id,identifier
185,4,fight-area 185,4,fight-area
186,4,survival-area 186,4,survival-area
187,4,seabreak-path 187,4,seabreak-path
188,4,hall-of-origin 188,4,sinnoh-hall-of-origin-1
189,4,hall-of-origin 189,4,sinnoh-hall-of-origin-2
190,4,verity-cavern 190,4,verity-cavern
191,4,valor-cavern 191,4,valor-cavern
192,4,acuity-cavern 192,4,acuity-cavern
@ -188,21 +188,21 @@ id,region_id,identifier
195,4,gts 195,4,gts
196,4,trainers-school 196,4,trainers-school
197,4,mining-museum 197,4,mining-museum
198,4,flower-shop 198,4,sinnoh-flower-shop
199,4,cycle-shop 199,4,sinnoh-cycle-shop
200,4,contest-hall 200,4,contest-hall
201,4,poffin-house 201,4,poffin-house
202,4,foreign-building 202,4,sinnoh-foreign-building
203,4,pokemon-day-care 203,4,pokemon-day-care
204,4,veilstone-store 204,4,veilstone-store
205,4,game-corner 205,4,sinnoh-game-corner
206,4,canalave-library 206,4,canalave-library
207,4,vista-lighthouse 207,4,vista-lighthouse
208,4,sunyshore-market 208,4,sunyshore-market
209,4,footstep-house 209,4,footstep-house
210,4,cafe 210,4,sinnoh-cafe
211,4,grand-lake 211,4,grand-lake
212,4,restaurant 212,4,sinnoh-restaurant
213,4,battle-park 213,4,battle-park
214,4,battle-frontier 214,4,battle-frontier
215,4,battle-factory 215,4,battle-factory
@ -210,8 +210,8 @@ id,region_id,identifier
217,4,battle-arcade 217,4,battle-arcade
218,4,battle-hall 218,4,battle-hall
219,4,distortion-world 219,4,distortion-world
220,4,global-terminal 220,4,sinnoh-global-terminal
221,4,villa 221,4,sinnoh-villa
222,4,battleground 222,4,battleground
223,4,rotoms-room 223,4,rotoms-room
224,4,tg-eterna-bldg 224,4,tg-eterna-bldg
@ -225,7 +225,7 @@ id,region_id,identifier
232,2,lavender-town 232,2,lavender-town
233,2,indigo-plateau 233,2,indigo-plateau
234,2,saffron-city 234,2,saffron-city
236,2,lighthouse 236,2,johto-lighthouse
237,2,team-rocket-hq 237,2,team-rocket-hq
238,2,goldenrod-tunnel 238,2,goldenrod-tunnel
239,2,mt-silver-cave 239,2,mt-silver-cave
@ -331,8 +331,8 @@ id,region_id,identifier
341,,concert-event 341,,concert-event
342,,mr-pokemon 342,,mr-pokemon
343,,primo 343,,primo
344,5,mystery-zone 344,5,unova-mystery-zone
345,5,faraway-place 345,5,unova-faraway-place
346,5,nuvema-town 346,5,nuvema-town
347,5,accumula-town 347,5,accumula-town
348,5,striaton-city 348,5,striaton-city
@ -343,24 +343,24 @@ id,region_id,identifier
353,5,mistralton-city 353,5,mistralton-city
354,5,icirrus-city 354,5,icirrus-city
355,5,opelucid-city 355,5,opelucid-city
356,5,route-1 356,5,unova-route-1
357,5,route-2 357,5,unova-route-2
358,5,route-3 358,5,unova-route-3
359,5,route-4 359,5,unova-route-4
360,5,route-5 360,5,unova-route-5
361,5,route-6 361,5,unova-route-6
362,5,route-7 362,5,unova-route-7
363,5,route-8 363,5,unova-route-8
364,5,route-9 364,5,unova-route-9
365,5,route-10 365,5,unova-route-10
366,5,route-11 366,5,unova-route-11
367,5,route-12 367,5,unova-route-12
368,5,route-13 368,5,unova-route-13
369,5,route-14 369,5,unova-route-14
370,5,route-15 370,5,unova-route-15
371,5,route-16 371,5,unova-route-16
372,5,route-17 372,5,unova-route-17
373,5,route-18 373,5,unova-route-18
374,5,dreamyard 374,5,dreamyard
375,5,pinwheel-forest 375,5,pinwheel-forest
376,5,desert-resort 376,5,desert-resort
@ -369,11 +369,11 @@ id,region_id,identifier
379,5,chargestone-cave 379,5,chargestone-cave
380,5,twist-mountain 380,5,twist-mountain
381,5,dragonspiral-tower 381,5,dragonspiral-tower
382,5,victory-road 382,5,unova-victory-road
383,5,lacunosa-town 383,5,lacunosa-town
384,5,undella-town 384,5,undella-town
385,5,anville-town 385,5,anville-town
386,5,pokemon-league 386,5,unova-pokemon-league
387,5,ns-castle 387,5,ns-castle
388,5,royal-unova 388,5,royal-unova
389,5,gear-station 389,5,gear-station
@ -387,7 +387,7 @@ id,region_id,identifier
397,5,rumination-field 397,5,rumination-field
398,5,celestial-tower 398,5,celestial-tower
399,5,moor-of-icirrus 399,5,moor-of-icirrus
400,5,shopping-mall 400,5,unova-shopping-mall
401,5,challengers-cave 401,5,challengers-cave
402,5,poke-transfer-lab 402,5,poke-transfer-lab
403,5,giant-chasm 403,5,giant-chasm
@ -431,53 +431,53 @@ id,region_id,identifier
441,3,mt-pyre 441,3,mt-pyre
442,3,seafloor-cavern 442,3,seafloor-cavern
443,3,cave-of-origin 443,3,cave-of-origin
444,3,victory-road 444,3,hoenn-victory-road
445,3,shoal-cave 445,3,shoal-cave
446,3,new-mauville 446,3,new-mauville
447,3,abandoned-ship 447,3,abandoned-ship
448,3,sky-pillar 448,3,sky-pillar
449,3,route-101 449,3,hoenn-route-101
450,3,route-102 450,3,hoenn-route-102
451,3,route-103 451,3,hoenn-route-103
452,3,route-104 452,3,hoenn-route-104
453,3,route-105 453,3,hoenn-route-105
454,3,route-106 454,3,hoenn-route-106
455,3,route-107 455,3,hoenn-route-107
456,3,route-108 456,3,hoenn-route-108
457,3,route-109 457,3,hoenn-route-109
458,3,route-110 458,3,hoenn-route-110
459,3,route-111 459,3,hoenn-route-111
460,3,route-112 460,3,hoenn-route-112
461,3,route-113 461,3,hoenn-route-113
462,3,route-114 462,3,hoenn-route-114
463,3,route-115 463,3,hoenn-route-115
464,3,route-116 464,3,hoenn-route-116
465,3,route-117 465,3,hoenn-route-117
466,3,route-118 466,3,hoenn-route-118
467,3,route-119 467,3,hoenn-route-119
468,3,route-120 468,3,hoenn-route-120
469,3,route-121 469,3,hoenn-route-121
470,3,route-122 470,3,hoenn-route-122
471,3,route-123 471,3,hoenn-route-123
472,3,route-124 472,3,hoenn-route-124
473,3,route-125 473,3,hoenn-route-125
474,3,route-126 474,3,hoenn-route-126
475,3,route-127 475,3,hoenn-route-127
476,3,route-128 476,3,hoenn-route-128
477,3,route-129 477,3,hoenn-route-129
478,3,route-130 478,3,hoenn-route-130
479,3,route-131 479,3,hoenn-route-131
480,3,route-132 480,3,hoenn-route-132
481,3,route-133 481,3,hoenn-route-133
482,3,route-134 482,3,hoenn-route-134
483,3,safari-zone 483,3,hoenn-safari-zone
484,3,dewford-town 484,3,dewford-town
485,3,pacifidlog-town 485,3,pacifidlog-town
486,3,magma-hideout 486,3,magma-hideout
487,3,mirage-tower 487,3,mirage-tower
488,3,desert-underpass 488,3,desert-underpass
489,3,artisan-cave 489,3,artisan-cave
490,3,altering-cave 490,3,hoenn-altering-cave
491,1,monean-chamber 491,1,monean-chamber
492,1,liptoo-chamber 492,1,liptoo-chamber
493,1,weepth-chamber 493,1,weepth-chamber
@ -486,7 +486,7 @@ id,region_id,identifier
496,1,rixy-chamber 496,1,rixy-chamber
497,1,viapos-chamber 497,1,viapos-chamber
498,1,ss-anne 498,1,ss-anne
499,1,victory-road 499,1,kanto-victory-road-3
500,1,mt-ember 500,1,mt-ember
501,1,berry-forest 501,1,berry-forest
502,1,icefall-cave 502,1,icefall-cave
@ -509,12 +509,12 @@ id,region_id,identifier
519,1,canyon-entrance 519,1,canyon-entrance
520,1,sevault-canyon 520,1,sevault-canyon
521,1,tanoby-ruins 521,1,tanoby-ruins
522,1,route-19 522,1,kanto-route-19
523,1,route-20 523,1,kanto-route-20
524,1,route-21 524,1,kanto-route-21
525,1,vermillion-city 525,1,vermillion-city
526,1,one-island 526,1,one-island
527,1,four-island 527,1,four-island
528,1,five-island 528,1,five-island
529,1,altering-cave 529,1,kanto-altering-cave
530,1,victory-road 530,1,kanto-victory-road-4

1 id region_id identifier
3 2 4 eterna-city
4 3 4 pastoria-city
5 4 4 sunyshore-city
6 5 4 pokemon-league sinnoh-pokemon-league
7 6 4 oreburgh-mine
8 7 4 valley-windworks
9 8 4 eterna-forest
11 10 4 mt-coronet
12 11 4 great-marsh
13 12 4 solaceon-ruins
14 13 4 victory-road sinnoh-victory-road
15 14 4 ravaged-path
16 15 4 oreburgh-gate
17 16 4 stark-mountain
28 28 4 lake-acuity
29 29 4 valor-lakefront
30 30 4 acuity-lakefront
31 31 4 route-201 sinnoh-route-201
32 32 4 route-202 sinnoh-route-202
33 33 4 route-203 sinnoh-route-203
34 34 4 route-204 sinnoh-route-204
35 35 4 route-205 sinnoh-route-205
36 36 4 route-206 sinnoh-route-206
37 37 4 route-207 sinnoh-route-207
38 38 4 route-208 sinnoh-route-208
39 39 4 route-209 sinnoh-route-209
40 40 4 lost-tower
41 41 4 route-210 sinnoh-route-210
42 42 4 route-211 sinnoh-route-211
43 43 4 route-212 sinnoh-route-212
44 44 4 route-213 sinnoh-route-213
45 45 4 route-214 sinnoh-route-214
46 46 4 route-215 sinnoh-route-215
47 47 4 route-216 sinnoh-route-216
48 48 4 route-217 sinnoh-route-217
49 49 4 route-218 sinnoh-route-218
50 50 4 route-219 sinnoh-route-219
51 51 4 route-221 sinnoh-route-221
52 52 4 route-222 sinnoh-route-222
53 53 4 route-224 sinnoh-route-224
54 54 4 route-225 sinnoh-route-225
55 55 4 route-227 sinnoh-route-227
56 56 4 route-228 sinnoh-route-228
57 57 4 route-229 sinnoh-route-229
58 58 4 twinleaf-town
59 59 4 celestic-town
60 60 4 resort-area
61 61 4 sea-route-220 sinnoh-sea-route-220
62 62 4 sea-route-223 sinnoh-sea-route-223
63 63 4 sea-route-226 sinnoh-sea-route-226
64 64 4 sea-route-230 sinnoh-sea-route-230
65 65 2 blackthorn-city
66 66 2 burned-tower
67 67 1 celadon-city
85 85 2 olivine-city
86 86 1 pallet-town
87 87 1 rock-tunnel
88 88 1 route-1 kanto-route-1
89 89 1 route-10 kanto-route-10
90 90 1 route-11 kanto-route-11
91 91 1 route-12 kanto-route-12
92 92 1 route-13 kanto-route-13
93 93 1 route-14 kanto-route-14
94 94 1 route-15 kanto-route-15
95 95 1 route-16 kanto-route-16
96 96 1 route-17 kanto-route-17
97 97 1 route-18 kanto-route-18
98 98 1 sea-route-19 kanto-sea-route-19
99 99 1 route-2 kanto-route-2
100 100 1 sea-route-20 kanto-sea-route-20
101 101 1 sea-route-21 kanto-sea-route-21
102 102 1 route-22 kanto-route-22
103 103 1 route-24 kanto-route-24
104 104 1 route-25 kanto-route-25
105 105 1 route-26 kanto-route-26
106 106 1 route-27 kanto-route-27
107 107 1 route-28 kanto-route-28
108 108 2 route-29 johto-route-29
109 109 1 route-3 kanto-route-3
110 110 2 route-30 johto-route-30
111 111 2 route-31 johto-route-31
112 112 2 route-32 johto-route-32
113 113 2 route-33 johto-route-33
114 114 2 route-34 johto-route-34
115 115 2 route-35 johto-route-35
116 116 2 route-36 johto-route-36
117 117 2 route-37 johto-route-37
118 118 2 route-38 johto-route-38
119 119 2 route-39 johto-route-39
120 120 1 route-4 kanto-route-4
121 121 2 sea-route-40 johto-sea-route-40
122 122 2 sea-route-41 johto-sea-route-41
123 123 2 route-42 johto-route-42
124 124 2 route-43 johto-route-43
125 125 2 route-44 johto-route-44
126 126 2 route-45 johto-route-45
127 127 2 route-46 johto-route-46
128 128 2 route-47 johto-route-47
129 129 2 route-48 johto-route-48
130 130 1 route-5 kanto-route-5
131 131 1 route-6 kanto-route-6
132 132 1 route-7 kanto-route-7
133 133 1 route-8 kanto-route-8
134 134 1 route-9 kanto-route-9
135 135 2 ruins-of-alph
136 136 1 seafoam-islands
137 137 2 slowpoke-well
144 149 2 unknown-all-rattata
145 150 2 unknown-all-bugs
146 151 1 vermilion-city
147 152 1 victory-road kanto-victory-road-1
148 153 2 violet-city
149 154 1 viridian-city
150 155 1 viridian-forest
151 156 2 whirl-islands
152 157 1 route-23 kanto-route-23
153 158 1 power-plant
154 159 1 victory-road kanto-victory-road-2
155 160 1 pokemon-tower
156 161 1 pokemon-mansion
157 162 1 safari-zone kanto-safari-zone
158 163 4 sandgem-town
159 164 4 floaroma-town
160 165 4 solaceon-town
178 185 4 fight-area
179 186 4 survival-area
180 187 4 seabreak-path
181 188 4 hall-of-origin sinnoh-hall-of-origin-1
182 189 4 hall-of-origin sinnoh-hall-of-origin-2
183 190 4 verity-cavern
184 191 4 valor-cavern
185 192 4 acuity-cavern
188 195 4 gts
189 196 4 trainers-school
190 197 4 mining-museum
191 198 4 flower-shop sinnoh-flower-shop
192 199 4 cycle-shop sinnoh-cycle-shop
193 200 4 contest-hall
194 201 4 poffin-house
195 202 4 foreign-building sinnoh-foreign-building
196 203 4 pokemon-day-care
197 204 4 veilstone-store
198 205 4 game-corner sinnoh-game-corner
199 206 4 canalave-library
200 207 4 vista-lighthouse
201 208 4 sunyshore-market
202 209 4 footstep-house
203 210 4 cafe sinnoh-cafe
204 211 4 grand-lake
205 212 4 restaurant sinnoh-restaurant
206 213 4 battle-park
207 214 4 battle-frontier
208 215 4 battle-factory
210 217 4 battle-arcade
211 218 4 battle-hall
212 219 4 distortion-world
213 220 4 global-terminal sinnoh-global-terminal
214 221 4 villa sinnoh-villa
215 222 4 battleground
216 223 4 rotoms-room
217 224 4 tg-eterna-bldg
225 232 2 lavender-town
226 233 2 indigo-plateau
227 234 2 saffron-city
228 236 2 lighthouse johto-lighthouse
229 237 2 team-rocket-hq
230 238 2 goldenrod-tunnel
231 239 2 mt-silver-cave
331 341 concert-event
332 342 mr-pokemon
333 343 primo
334 344 5 mystery-zone unova-mystery-zone
335 345 5 faraway-place unova-faraway-place
336 346 5 nuvema-town
337 347 5 accumula-town
338 348 5 striaton-city
343 353 5 mistralton-city
344 354 5 icirrus-city
345 355 5 opelucid-city
346 356 5 route-1 unova-route-1
347 357 5 route-2 unova-route-2
348 358 5 route-3 unova-route-3
349 359 5 route-4 unova-route-4
350 360 5 route-5 unova-route-5
351 361 5 route-6 unova-route-6
352 362 5 route-7 unova-route-7
353 363 5 route-8 unova-route-8
354 364 5 route-9 unova-route-9
355 365 5 route-10 unova-route-10
356 366 5 route-11 unova-route-11
357 367 5 route-12 unova-route-12
358 368 5 route-13 unova-route-13
359 369 5 route-14 unova-route-14
360 370 5 route-15 unova-route-15
361 371 5 route-16 unova-route-16
362 372 5 route-17 unova-route-17
363 373 5 route-18 unova-route-18
364 374 5 dreamyard
365 375 5 pinwheel-forest
366 376 5 desert-resort
369 379 5 chargestone-cave
370 380 5 twist-mountain
371 381 5 dragonspiral-tower
372 382 5 victory-road unova-victory-road
373 383 5 lacunosa-town
374 384 5 undella-town
375 385 5 anville-town
376 386 5 pokemon-league unova-pokemon-league
377 387 5 ns-castle
378 388 5 royal-unova
379 389 5 gear-station
387 397 5 rumination-field
388 398 5 celestial-tower
389 399 5 moor-of-icirrus
390 400 5 shopping-mall unova-shopping-mall
391 401 5 challengers-cave
392 402 5 poke-transfer-lab
393 403 5 giant-chasm
431 441 3 mt-pyre
432 442 3 seafloor-cavern
433 443 3 cave-of-origin
434 444 3 victory-road hoenn-victory-road
435 445 3 shoal-cave
436 446 3 new-mauville
437 447 3 abandoned-ship
438 448 3 sky-pillar
439 449 3 route-101 hoenn-route-101
440 450 3 route-102 hoenn-route-102
441 451 3 route-103 hoenn-route-103
442 452 3 route-104 hoenn-route-104
443 453 3 route-105 hoenn-route-105
444 454 3 route-106 hoenn-route-106
445 455 3 route-107 hoenn-route-107
446 456 3 route-108 hoenn-route-108
447 457 3 route-109 hoenn-route-109
448 458 3 route-110 hoenn-route-110
449 459 3 route-111 hoenn-route-111
450 460 3 route-112 hoenn-route-112
451 461 3 route-113 hoenn-route-113
452 462 3 route-114 hoenn-route-114
453 463 3 route-115 hoenn-route-115
454 464 3 route-116 hoenn-route-116
455 465 3 route-117 hoenn-route-117
456 466 3 route-118 hoenn-route-118
457 467 3 route-119 hoenn-route-119
458 468 3 route-120 hoenn-route-120
459 469 3 route-121 hoenn-route-121
460 470 3 route-122 hoenn-route-122
461 471 3 route-123 hoenn-route-123
462 472 3 route-124 hoenn-route-124
463 473 3 route-125 hoenn-route-125
464 474 3 route-126 hoenn-route-126
465 475 3 route-127 hoenn-route-127
466 476 3 route-128 hoenn-route-128
467 477 3 route-129 hoenn-route-129
468 478 3 route-130 hoenn-route-130
469 479 3 route-131 hoenn-route-131
470 480 3 route-132 hoenn-route-132
471 481 3 route-133 hoenn-route-133
472 482 3 route-134 hoenn-route-134
473 483 3 safari-zone hoenn-safari-zone
474 484 3 dewford-town
475 485 3 pacifidlog-town
476 486 3 magma-hideout
477 487 3 mirage-tower
478 488 3 desert-underpass
479 489 3 artisan-cave
480 490 3 altering-cave hoenn-altering-cave
481 491 1 monean-chamber
482 492 1 liptoo-chamber
483 493 1 weepth-chamber
486 496 1 rixy-chamber
487 497 1 viapos-chamber
488 498 1 ss-anne
489 499 1 victory-road kanto-victory-road-3
490 500 1 mt-ember
491 501 1 berry-forest
492 502 1 icefall-cave
509 519 1 canyon-entrance
510 520 1 sevault-canyon
511 521 1 tanoby-ruins
512 522 1 route-19 kanto-route-19
513 523 1 route-20 kanto-route-20
514 524 1 route-21 kanto-route-21
515 525 1 vermillion-city
516 526 1 one-island
517 527 1 four-island
518 528 1 five-island
519 529 1 altering-cave kanto-altering-cave
520 530 1 victory-road kanto-victory-road-4

View file

@ -0,0 +1,80 @@
# Encoding: UTF-8
"""Automatically disambiguate location identifiers
This is an unmaintained one-shot script, only included in the repo for reference.
Disambiguates identifiers that aren't unique, Routes and Sea Routes, and
generic names like 'villa' or 'game corner' that could appear in future
generations again.
Does this by prepending the region name, and if that isn't enough, appends
numbers.
"""
import sys
import re
from collections import defaultdict
from pokedex.db import connect, tables
ambiguous_re = re.compile(r'^(sea-)?route-\d+$')
ambiguous_set = set('foreign-building game-corner global-terminal lighthouse '
'restaurant flower-shop cycle-shop cafe shopping-mall villa'.split())
def main(*argv):
session = connect()
location_dict = defaultdict(list)
for location in session.query(tables.Location).order_by(tables.Location.id):
location_dict[location.identifier].append(location)
changes = False
for identifier, locations in sorted(location_dict.items()):
disambiguate = any((
len(locations) > 1,
ambiguous_re.match(identifier),
identifier in ambiguous_set,
))
print len(locations), ' *'[disambiguate], identifier,
if disambiguate:
changes = True
print u''.encode('utf-8'),
by_region = defaultdict(list)
for location in locations:
if location.region:
by_region[location.region.identifier].append(location)
else:
by_region[None].append(location)
for region_identifier, region_locations in by_region.items():
if region_identifier:
new_identifier = '%s-%s' % (region_identifier, identifier)
else:
# No change
new_identifier = identifier
if len(region_locations) == 1:
location = region_locations[0]
# The region was enough
print new_identifier,
location.identifier = new_identifier
else:
# Need to number the locations :(
for i, location in enumerate(region_locations, start=1):
numbered_identifier = '%s-%s' % (new_identifier, i)
print numbered_identifier,
location.identifier = numbered_identifier
print
if changes:
if argv and argv[0] == '--commit':
session.commit()
print 'Committed'
else:
print 'Run with --commit to commit changes'
else:
print 'No changes needed'
if __name__ == '__main__':
main(*sys.argv[1:])