Somewhere On The Tube ...But On Which Lines?

ES6, Node.js / Chrome, 989 977 931 892 889 887 bytes

s=>"Bakerloo,Central,Circle,District,Hammersmith & City,Jubilee,Metropolitan,Northern,Piccadilly,Victoria,Waterloo & City".split`,`.filter((_,i)=>parseInt('7c1w0o741s3k39w22c020c080we80y3l0a8w0t3xhs2olc7g0km87w0176r8ao2e4g0q5w0eeb753mekwx1k18'.substr(" 5Kd5_9 5c4^5];`3]3 4]4^<`Y`0^5h3 9 ;<K 9^2b<`3 Wf9 9`E 0<a;< ; 9`;]2o4b99a33d5`; 3`3jB]Kj9b55e8m5]= KmS ;]K5`9^9]<_3^0 ;]3_3]3 99;b=]K 3 Xe95`9_Qd5_0o3b;];bKf=e=b3jH_<]4d; 3g:d45eT]J_5Kk4{2q9_Kc4c<l9vD`9; 9eIc2^D]<]5a3d8`5hF 4jKhLUm3|5]: ;a5{<> :^3d5t9]5l6_A~f9h5]5b5b9hK]9]: 5l4:a5m9}4^@oHkH^3e3c1c4nBf<bHa:w=b;]AsDl; K`H~K]3d;f8r9 4n9eV]9 <^9~3n=l<]9]5]5a9kK 5 5`: =g:aHcAb2q?_2b0tAsNc;]9]9_3e5e3qAkR^Ac5bK Mc?a;9t=y2_;]5b3_2e<vOd4_9i;^C`9w;a3p:a<j9]5 7Ke:_<3 9`5_Ga4h9t8_9^>e3]H^Eg5zAe4cZ_;ePGm2 3a3".replace(/./g,c=>c.repeat((n=c[C='charCodeAt']())<92||n-91))[C](parseInt(s.replace(/\W|\d/g,''),36)*79%2777%2328)*2-96,2),36)>>i&1)

Full test suite (Node.js)

Try it online!

Demo (Chrome)

NB: Due to inconsistencies in the implementation of parseInt() across browsers(1), this is only guaranteed to work for all stations on Chrome.

let f =

s=>"Bakerloo,Central,Circle,District,Hammersmith & City,Jubilee,Metropolitan,Northern,Piccadilly,Victoria,Waterloo & City".split`,`.filter((_,i)=>parseInt('7c1w0o741s3k39w22c020c080we80y3l0a8w0t3xhs2olc7g0km87w0176r8ao2e4g0q5w0eeb753mekwx1k18'.substr(" 5Kd5_9 5c4^5];`3]3 4]4^<`Y`0^5h3 9 ;<K 9^2b<`3 Wf9 9`E 0<a;< ; 9`;]2o4b99a33d5`; 3`3jB]Kj9b55e8m5]= KmS ;]K5`9^9]<_3^0 ;]3_3]3 99;b=]K 3 Xe95`9_Qd5_0o3b;];bKf=e=b3jH_<]4d; 3g:d45eT]J_5Kk4{2q9_Kc4c<l9vD`9; 9eIc2^D]<]5a3d8`5hF 4jKhLUm3|5]: ;a5{<> :^3d5t9]5l6_A~f9h5]5b5b9hK]9]: 5l4:a5m9}4^@oHkH^3e3c1c4nBf<bHa:w=b;]AsDl; K`H~K]3d;f8r9 4n9eV]9 <^9~3n=l<]9]5]5a9kK 5 5`: =g:aHcAb2q?_2b0tAsNc;]9]9_3e5e3qAkR^Ac5bK Mc?a;9t=y2_;]5b3_2e<vOd4_9i;^C`9w;a3p:a<j9]5 7Ke:_<3 9`5_Ga4h9t8_9^>e3]H^Eg5zAe4cZ_;ePGm2 3a3".replace(/./g,c=>c.repeat((n=c[C='charCodeAt']())<92||n-91))[C](parseInt(s.replace(/\W|\d/g,''),36)*79%2777%2328)*2-96,2),36)>>i&1)
<select onclick="O.innerText=f(this.options[this.selectedIndex].text).join(', ')">
<option>-- Where do you want to go? --</option>
<option>Acton Town</option>
<option>Aldgate</option>
<option>Aldgate East</option>
<option>Alperton</option>
<option>Amersham</option>
<option>Angel</option>
<option>Archway</option>
<option>Arnos Grove</option>
<option>Arsenal</option>
<option>Baker Street</option>
<option>Balham</option>
<option>Bank</option>
<option>Barbican</option>
<option>Barking</option>
<option>Barkingside</option>
<option>Barons Court</option>
<option>Bayswater</option>
<option>Becontree</option>
<option>Belsize Park</option>
<option>Bermondsey</option>
<option>Bethnal Green</option>
<option>Blackfriars</option>
<option>Blackhorse Road</option>
<option>Bond Street</option>
<option>Borough</option>
<option>Boston Manor</option>
<option>Bounds Green</option>
<option>Bow Road</option>
<option>Brent Cross</option>
<option>Brixton</option>
<option>Bromley-by-Bow</option>
<option>Buckhurst Hill</option>
<option>Burnt Oak</option>
<option>Caledonian Road</option>
<option>Camden Town</option>
<option>Canada Water</option>
<option>Canary Wharf</option>
<option>Canning Town</option>
<option>Cannon Street</option>
<option>Canons Park</option>
<option>Chalfont & Latimer</option>
<option>Chalk Farm</option>
<option>Chancery Lane</option>
<option>Charing Cross</option>
<option>Chesham</option>
<option>Chigwell</option>
<option>Chiswick Park</option>
<option>Chorleywood</option>
<option>Clapham Common</option>
<option>Clapham North</option>
<option>Clapham South</option>
<option>Cockfosters</option>
<option>Colindale</option>
<option>Colliers Wood</option>
<option>Covent Garden</option>
<option>Croxley</option>
<option>Dagenham East</option>
<option>Dagenham Heathway</option>
<option>Debden</option>
<option>Dollis Hill</option>
<option>Ealing Broadway</option>
<option>Ealing Common</option>
<option>Earl's Court</option>
<option>East Acton</option>
<option>East Finchley</option>
<option>East Ham</option>
<option>East Putney</option>
<option>Eastcote</option>
<option>Edgware</option>
<option>Edgware Road</option>
<option>Elephant & Castle</option>
<option>Elm Park</option>
<option>Embankment</option>
<option>Epping</option>
<option>Euston</option>
<option>Euston Square</option>
<option>Fairlop</option>
<option>Farringdon</option>
<option>Finchley Central</option>
<option>Finchley Road</option>
<option>Finsbury Park</option>
<option>Fulham Broadway</option>
<option>Gants Hill</option>
<option>Gloucester Road</option>
<option>Golders Green</option>
<option>Goldhawk Road</option>
<option>Goodge Street</option>
<option>Grange Hill</option>
<option>Great Portland Street</option>
<option>Greenford</option>
<option>Green Park</option>
<option>Gunnersbury</option>
<option>Hainault</option>
<option>Hammersmith</option>
<option>Hampstead</option>
<option>Hanger Lane</option>
<option>Harlesden</option>
<option>Harrow & Wealdstone</option>
<option>Harrow-on-the-Hill</option>
<option>Hatton Cross</option>
<option>Heathrow Terminals 1, 2, 3</option>
<option>Heathrow Terminal 4</option>
<option>Heathrow Terminal 5</option>
<option>Hendon Central</option>
<option>High Barnet</option>
<option>Highbury & Islington</option>
<option>Highgate</option>
<option>High Street Kensington</option>
<option>Hillingdon</option>
<option>Holborn</option>
<option>Holland Park</option>
<option>Holloway Road</option>
<option>Hornchurch</option>
<option>Hounslow Central</option>
<option>Hounslow East</option>
<option>Hounslow West</option>
<option>Hyde Park Corner</option>
<option>Ickenham</option>
<option>Kennington</option>
<option>Kensal Green</option>
<option>Kensington (Olympia)</option>
<option>Kentish Town</option>
<option>Kenton</option>
<option>Kew Gardens</option>
<option>Kilburn</option>
<option>Kilburn Park</option>
<option>Kingsbury</option>
<option>King's Cross St. Pancras</option>
<option>Knightsbridge</option>
<option>Ladbroke Grove</option>
<option>Lambeth North</option>
<option>Lancaster Gate</option>
<option>Latimer Road</option>
<option>Leicester Square</option>
<option>Leyton</option>
<option>Leytonstone</option>
<option>Liverpool Street</option>
<option>London Bridge</option>
<option>Loughton</option>
<option>Maida Vale</option>
<option>Manor House</option>
<option>Mansion House</option>
<option>Marble Arch</option>
<option>Marylebone</option>
<option>Mile End</option>
<option>Mill Hill East</option>
<option>Monument</option>
<option>Moorgate</option>
<option>Moor Park</option>
<option>Morden</option>
<option>Mornington Crescent</option>
<option>Neasden</option>
<option>Newbury Park</option>
<option>North Acton</option>
<option>North Ealing</option>
<option>North Greenwich</option>
<option>North Harrow</option>
<option>North Wembley</option>
<option>Northfields</option>
<option>Northolt</option>
<option>Northwick Park</option>
<option>Northwood</option>
<option>Northwood Hills</option>
<option>Notting Hill Gate</option>
<option>Oakwood</option>
<option>Old Street</option>
<option>Osterley</option>
<option>Oval</option>
<option>Oxford Circus</option>
<option>Paddington</option>
<option>Park Royal</option>
<option>Parsons Green</option>
<option>Perivale</option>
<option>Piccadilly Circus</option>
<option>Pimlico</option>
<option>Pinner</option>
<option>Plaistow</option>
<option>Preston Road</option>
<option>Putney Bridge</option>
<option>Queen's Park</option>
<option>Queensbury</option>
<option>Queensway</option>
<option>Ravenscourt Park</option>
<option>Rayners Lane</option>
<option>Redbridge</option>
<option>Regent's Park</option>
<option>Richmond</option>
<option>Rickmansworth</option>
<option>Roding Valley</option>
<option>Royal Oak</option>
<option>Ruislip</option>
<option>Ruislip Gardens</option>
<option>Ruislip Manor</option>
<option>Russell Square</option>
<option>St. James's Park</option>
<option>St. John's Wood</option>
<option>St. Paul's</option>
<option>Seven Sisters</option>
<option>Shepherd's Bush</option>
<option>Shepherd's Bush Market</option>
<option>Sloane Square</option>
<option>Snaresbrook</option>
<option>South Ealing</option>
<option>South Harrow</option>
<option>South Kensington</option>
<option>South Kenton</option>
<option>South Ruislip</option>
<option>South Wimbledon</option>
<option>South Woodford</option>
<option>Southfields</option>
<option>Southgate</option>
<option>Southwark</option>
<option>Stamford Brook</option>
<option>Stanmore</option>
<option>Stepney Green</option>
<option>Stockwell</option>
<option>Stonebridge Park</option>
<option>Stratford</option>
<option>Sudbury Hill</option>
<option>Sudbury Town</option>
<option>Swiss Cottage</option>
<option>Temple</option>
<option>Theydon Bois</option>
<option>Tooting Bec</option>
<option>Tooting Broadway</option>
<option>Tottenham Court Road</option>
<option>Tottenham Hale</option>
<option>Totteridge & Whetstone</option>
<option>Tower Hill</option>
<option>Tufnell Park</option>
<option>Turnham Green</option>
<option>Turnpike Lane</option>
<option>Upminster</option>
<option>Upminster Bridge</option>
<option>Upney</option>
<option>Upton Park</option>
<option>Uxbridge</option>
<option>Vauxhall</option>
<option>Victoria</option>
<option>Walthamstow Central</option>
<option>Wanstead</option>
<option>Warren Street</option>
<option>Warwick Avenue</option>
<option>Waterloo</option>
<option>Watford</option>
<option>Wembley Central</option>
<option>Wembley Park</option>
<option>West Acton</option>
<option>West Brompton</option>
<option>West Finchley</option>
<option>West Ham</option>
<option>West Hampstead</option>
<option>West Harrow</option>
<option>West Kensington</option>
<option>West Ruislip</option>
<option>Westbourne Park</option>
<option>Westminster</option>
<option>White City</option>
<option>Whitechapel</option>
<option>Willesden Green</option>
<option>Willesden Junction</option>
<option>Wimbledon</option>
<option>Wimbledon Park</option>
<option>Wood Green</option>
<option>Wood Lane</option>
<option>Woodford</option>
<option>Woodside Park</option>
</select>
<pre id=O></pre>

(1) From the specification: Let mathInt be the mathematical integer value that is represented by Z in radix-R notation [...]. If R is not 2, 4, 8, 10, 16, or 32, then mathInt may be an implementation-dependent approximation to the mathematical integer value that is represented by Z in radix-R notation.


How?

Below is a step-by-step decoding example for the input s = "St. James's Park".

Step #1

We first inflate the primary lookup table (from 503 to 2,328 bytes) by expanding all its padding characters. These characters are encoded with an ASCII code greater than 92, whereas payload data is using the range 48-90.

tbl = " 5Kd5_9 5c4[...]"
  .replace(
    /./g, c =>
      c.repeat((n = c.charCodeAt()) < 92 || n - 91)
  )

Step #2

We remove all non-alphabetic characters from the input string:

str = s.replace(/\W|\d/g, '')

which gives "StJamessPark".

Step #3

We parse the resulting string as a base-36 quantity:

id = parseInt(str, 36)

which gives 3793395908848905700 (this is the approximated result returned by Chrome V8).

Step #4

We compute the hash value:

hash = id * 79 % 2777 % 2328

which gives 533.

NB: Due to loss of precision, this result is not mathematically correct (it should be 184). But the lookup table was -- of course -- built the same way, so that's the one we're expecting.

Step #5

We retrieve the ASCII code of the character at this position in the primary lookup table:

code = tbl.charCodeAt(hash)

which gives 58 (this is the character ':').

Step #6

We use this value to extract a 2-character string from the secondary lookup table:

msk36 = '7c1w0o74[...]'.substr(code * 2 - 96, 2)

which gives 0c.

Step #7

We parse this string as a base-36 quantity:

msk = parseInt(msk36, 36)

which gives 12.

Step #8

Finally, we filter the station list according to the bits set in msk, starting with the least significant one:

"Bakerloo,Central,Circle,District,[...]".split`,`.filter((_, i) => msk >> i & 1)

In our example, msk holds 12, which is 00000001100 in binary. So we keep the 3rd and 4th stations, which leads to the final result: [ 'Circle', 'District' ].


Mathematica 8+, 266 bytes

t=Merge[Cases[<<ExamplePages/TripPlanning.nb,_@v__~_~{_->l_}:>(#->l&/@{v}),-1],Union@@#&];
x(r=t@@Nearest[Keys@t]@StringReplace[__~~"d Lane"|"ket"->"Royal Oak"]@x;DeleteCases[
  If[x<>r[[1]]//StringFreeQ@"sm",{},{"Circle"}]⋃r,"Overground"|"Docklands Light Rail"])

This solution originally had the same number of bytes as there are stations. I suppose it could be golfed down another 50 or so bytes, but this seemed like a fitting place to stop for now.


Introduction

Mathematica is well known for its large standard library and access to a large online "computable knowledge base." I brazenly searched Wolfram|Alpha hoping to easily find the relevant transit data, but although it understands the domain of my query, the data is not yet available.

Fortunately, Mathematica's extensive built-in documentation comes with neat examples. Several of those pages just happen to use the London Underground network to demonstrate graph-related functionality. We will use the graph from the "Trip Planning" featured example due to its short name.

Here are other cool uses of the same network.

I do not believe that programmatically accessing Mathematica's own documentation falls into the "Fetching from an external source"-type loopholes.


Import the example page

We can import the example page as a notebook expression:

<<ExamplePages/TripPlanning.nb
Notebook[{Cell[ ... ], ... }, Saveable -> False, ...]

It is possible to extract the whole graph from deep inside the notebook expression:

g = FirstCase[<< ExamplePages/TripPlanning.nb, _Graph, , -1];
VertexList[g]
{"Acton Central", "Acton Town", "Aldgate", ...}  

Note that the vertices of the graph are just the station names. The edges have a custom "Lines" property that is a list of strings representing the lines that pass between its two stations:

# -> PropertyValue[{g, #}, "Lines"] & /@ EdgeList[g]
{...,
 "Acton Town" <-> "Chiswick Park" -> {"District"}, 
 "Acton Town" <-> "Ealing Common" -> {"District", "Piccadilly"},
 ...}

Now, we could find all the lines passing through a vertex by getting all its incident edges from IncidenceList[g, vertex], mapping PropertyValue[{g, edge}, "Lines"] over them, and so on.

However, we will skip the above method and save many bytes by pattern matching for the relevant part of the Graph constructor – the Properties option.

Extract the lines

The Graph constructor has the following format:

Graph[
  {v1, v2, ...},
  {e1, e2, ...},
  Properties -> {
    v1 -> {propertyName -> propertyValue},
    e1 -> {propertyName -> propertyValue},   (* one edge property *)
    ...
  }
]

(You can see this by inspecting FullForm[g] or reading the source code of TripPlanning.nb – for its full path, run FindFile["ExamplePages/TripPlanning.nb"].)

Here is an example of one edge property:

UndirectedEdge["Embankment", "Waterloo"] -> {"Lines" -> {"Bakerloo", "Northern"}}

Let's turn this expression into a compact pattern:

UndirectedEdge[v1_, v2_]  ->      {"Lines" -> lines_}
UndirectedEdge[v1_, v2_]  ~Rule~  {"Lines" -> lines_}
UndirectedEdge[v__]       ~Rule~  {_       -> lines_}
             _[v__]       ~Rule~  {_       -> l_    }
             _@v__        ~_~     {_       -> l_    }

             _@v__~_~{_->l_}

Make a lookup table

Now we can match v1, v2, and lines, but we want {v1 -> lines, v2 -> lines}. Helpfully, Cases can simultaneously match a pattern and transform it.

Cases[notebook,  _@v__~_~{_->l_} :> (# -> l & /@ { v }),  -1]
                 [ the pattern ]    [ the replacement ]

This produces a list of the form {{v1 -> lines, v2 -> lines}, {v1 -> lines, v3 -> lines}, ...}. Finally, we merge the list by vertex:

t=Merge[Cases[...], Union@@#&];

In under 90 bytes, we have produced an almost-perfect lookup table for each station's lines.

t=Merge[Cases[<<ExamplePages/TripPlanning.nb,_@s__~_~{_->l_}:>(#->l&/@{s}),-1],Union@@#&]
<| "Embankment"       -> {"Bakerloo", "Circle", "District", "Northern"},
   "Waterloo"         -> {"Bakerloo", "Jubilee", "Northern", "Waterloo & City"},
   "Brondesbury"      -> {"Overground"},
    ... |>

Fix typos

Unfortunately, some station names are misspelled or missing.

Fuzzy string matching should take care of the typos. We can find the Nearest misspelled station name to the input station name:

Nearest[Keys@t]

Replace inputs of "Wood Lane" and "Shepherd's Bush Market" (new stations) with "Royal Oak", since those three stations share the same lines:

StringReplace[__ ~~ "d Lane" | "ket" -> "Royal Oak"]

Compose those functions to get the fake station name, look up its lines in the table, and store in r:

r=t@@Nearest[Keys@t]@StringReplace[__~~"d Lane"|"ket"->"Royal Oak"]@x

Fix outdated

The network is also slightly outdated due to the Circle Line overhaul.

If the input station is "Hammersmith" or if the lookup table returns only {"Hammersmith & City"}, then add "Circle" to the lines.

If[x <> r[[1]] // StringFreeQ@"sm", {}, {"Circle"}] ⋃ r

Remove extraneous lines

The graph contains some lines that we don't care about, so remove them:

DeleteCases[..., "Overground"|"Docklands Light Rail"]

That's it!


Try it! (with workarounds)

If you want to play around with my solution but don't have Mathematica, you can use the free Wolfram Programming Cloud. Go here, click Create a New Notebook, then wait a moment.

Unfortunately, the platform has some limitations that prevent my notebook-importing code from working. Here are some crude workarounds:

Since the example page is not there, we can try to abuse the copy-input-to-clipboard function from the online documentation. I used my browser's developer tools and saw that a request was made to http://reference.wolfram.com/language/example/Files/TripPlanning.en/i_1.txt (warning: large). However, the platform's proxy doesn't resolve the domain reference.wolfram.com, so I just did it manually.

gWorkaround = ToExpression[
  FirstCase[
    Import["http://140.177.205.163/language/example/Files/TripPlanning.en/i_1.txt",
      {"HTML","XMLObject"}],
    XMLElement["pre", _, {a_}] :> a,
    ,-1
  ],
  InputForm, Hold];

Paste this in first and press shift+enter to execute. Now replace <<ExamplePages/TripPlanning.nb with gWorkaround.


Test data

Call the function f and test it on the given data:

f = %;

testData = <|"Acton Town" -> {"District", "Piccadilly"}, "Aldgate" -> {"Circle", "Metropolitan"}, "Aldgate East" -> {"District", "Hammersmith & City"}, "Alperton" -> {"Piccadilly"}, "Amersham" -> {"Metropolitan"}, "Angel" -> {"Northern"}, "Archway" -> {"Northern"}, "Arnos Grove" -> {"Piccadilly"}, "Arsenal" -> {"Piccadilly"}, "Baker Street" -> {"Bakerloo", "Circle", "Hammersmith & City", "Jubilee", "Metropolitan"}, "Balham" -> {"Northern"}, "Bank" -> {"Central", "Northern", "Waterloo & City"}, "Barbican" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Barking" -> {"District", "Hammersmith & City"}, "Barkingside" -> {"Central"}, "Barons Court" -> {"District", "Piccadilly"}, "Bayswater" -> {"Circle", "District"}, "Becontree" -> {"District"}, "Belsize Park" -> {"Northern"}, "Bermondsey" -> {"Jubilee"}, "Bethnal Green" -> {"Central"}, "Blackfriars" -> {"Circle", "District"}, "Blackhorse Road" -> {"Victoria"}, "Bond Street" -> {"Central", "Jubilee"}, "Borough" -> {"Northern"}, "Boston Manor" -> {"Piccadilly"}, "Bounds Green" -> {"Piccadilly"}, "Bow Road" -> {"District", "Hammersmith & City"}, "Brent Cross" -> {"Northern"}, "Brixton" -> {"Victoria"}, "Bromley-by-Bow" -> {"District", "Hammersmith & City"}, "Buckhurst Hill" -> {"Central"}, "Burnt Oak" -> {"Northern"}, "Caledonian Road" -> {"Piccadilly"}, "Camden Town" -> {"Northern"}, "Canada Water" -> {"Jubilee"}, "Canary Wharf" -> {"Jubilee"}, "Canning Town" -> {"Jubilee"}, "Cannon Street" -> {"Circle", "District"}, "Canons Park" -> {"Jubilee"}, "Chalfont & Latimer" -> {"Metropolitan"}, "Chalk Farm" -> {"Northern"}, "Chancery Lane" -> {"Central"}, "Charing Cross" -> {"Bakerloo", "Northern"}, "Chesham" -> {"Metropolitan"}, "Chigwell" -> {"Central"}, "Chiswick Park" -> {"District"}, "Chorleywood" -> {"Metropolitan"}, "Clapham Common" -> {"Northern"}, "Clapham North" -> {"Northern"}, "Clapham South" -> {"Northern"}, "Cockfosters" -> {"Piccadilly"}, "Colindale" -> {"Northern"}, "Colliers Wood" -> {"Northern"}, "Covent Garden" -> {"Piccadilly"}, "Croxley" -> {"Metropolitan"}, "Dagenham East" -> {"District"}, "Dagenham Heathway" -> {"District"}, "Debden" -> {"Central"}, "Dollis Hill" -> {"Jubilee"}, "Ealing Broadway" -> {"Central", "District"}, "Ealing Common" -> {"District", "Piccadilly"}, "Earl's Court" -> {"District", "Piccadilly"}, "East Acton" -> {"Central"}, "East Finchley" -> {"Northern"}, "East Ham" -> {"District", "Hammersmith & City"}, "East Putney" -> {"District"}, "Eastcote" -> {"Metropolitan", "Piccadilly"}, "Edgware" -> {"Northern"}, "Edgware Road" -> {"Bakerloo", "Circle", "District", "Hammersmith & City"}, "Elephant & Castle" -> {"Bakerloo", "Northern"}, "Elm Park" -> {"District"}, "Embankment" -> {"Bakerloo", "Circle", "District", "Northern"}, "Epping" -> {"Central"}, "Euston" -> {"Northern", "Victoria"}, "Euston Square" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Fairlop" -> {"Central"}, "Farringdon" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Finchley Central" -> {"Northern"}, "Finchley Road" -> {"Jubilee", "Metropolitan"}, "Finsbury Park" -> {"Piccadilly", "Victoria"}, "Fulham Broadway" -> {"District"}, "Gants Hill" -> {"Central"}, "Gloucester Road" -> {"Circle", "District", "Piccadilly"}, "Golders Green" -> {"Northern"}, "Goldhawk Road" -> {"Circle", "Hammersmith & City"}, "Goodge Street" -> {"Northern"}, "Grange Hill" -> {"Central"}, "Great Portland Street" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Greenford" -> {"Central"}, "Green Park" -> {"Jubilee", "Piccadilly", "Victoria"}, "Gunnersbury" -> {"District"}, "Hainault" -> {"Central"}, "Hammersmith" -> {"Circle", "District", "Hammersmith & City", "Piccadilly"}, "Hampstead" -> {"Northern"}, "Hanger Lane" -> {"Central"}, "Harlesden" -> {"Bakerloo"}, "Harrow & Wealdstone" -> {"Bakerloo"}, "Harrow-on-the-Hill" -> {"Metropolitan"}, "Hatton Cross" -> {"Piccadilly"}, "Heathrow Terminals 1, 2, 3" -> {"Piccadilly"}, "Heathrow Terminal 4" -> {"Piccadilly"}, "Heathrow Terminal 5" -> {"Piccadilly"}, "Hendon Central" -> {"Northern"}, "High Barnet" -> {"Northern"}, "Highbury & Islington" -> {"Victoria"}, "Highgate" -> {"Northern"}, "High Street Kensington" -> {"Circle", "District"}, "Hillingdon" -> {"Metropolitan", "Piccadilly"}, "Holborn" -> {"Central", "Piccadilly"}, "Holland Park" -> {"Central"}, "Holloway Road" -> {"Piccadilly"}, "Hornchurch" -> {"District"}, "Hounslow Central" -> {"Piccadilly"}, "Hounslow East" -> {"Piccadilly"}, "Hounslow West" -> {"Piccadilly"}, "Hyde Park Corner" -> {"Piccadilly"}, "Ickenham" -> {"Metropolitan", "Piccadilly"}, "Kennington" -> {"Northern"}, "Kensal Green" -> {"Bakerloo"}, "Kensington (Olympia)" -> {"District"}, "Kentish Town" -> {"Northern"}, "Kenton" -> {"Bakerloo"}, "Kew Gardens" -> {"District"}, "Kilburn" -> {"Jubilee"}, "Kilburn Park" -> {"Bakerloo"}, "Kingsbury" -> {"Jubilee"}, "King's Cross St. Pancras" -> {"Circle", "Hammersmith & City", "Metropolitan", "Northern", "Piccadilly", "Victoria"}, "Knightsbridge" -> {"Piccadilly"}, "Ladbroke Grove" -> {"Circle", "Hammersmith & City"}, "Lambeth North" -> {"Bakerloo"}, "Lancaster Gate" -> {"Central"}, "Latimer Road" -> {"Circle", "Hammersmith & City"}, "Leicester Square" -> {"Northern", "Piccadilly"}, "Leyton" -> {"Central"}, "Leytonstone" -> {"Central"}, "Liverpool Street" -> {"Central", "Circle", "Hammersmith & City", "Metropolitan"}, "London Bridge" -> {"Jubilee", "Northern"}, "Loughton" -> {"Central"}, "Maida Vale" -> {"Bakerloo"}, "Manor House" -> {"Piccadilly"}, "Mansion House" -> {"Circle", "District"}, "Marble Arch" -> {"Central"}, "Marylebone" -> {"Bakerloo"}, "Mile End" -> {"Central", "District", "Hammersmith & City"}, "Mill Hill East" -> {"Northern"}, "Monument" -> {"Circle", "District"}, "Moorgate" -> {"Circle", "Hammersmith & City", "Metropolitan", "Northern"}, "Moor Park" -> {"Metropolitan"}, "Morden" -> {"Northern"}, "Mornington Crescent" -> {"Northern"}, "Neasden" -> {"Jubilee"}, "Newbury Park" -> {"Central"}, "North Acton" -> {"Central"}, "North Ealing" -> {"Piccadilly"}, "North Greenwich" -> {"Jubilee"}, "North Harrow" -> {"Metropolitan"}, "North Wembley" -> {"Bakerloo"}, "Northfields" -> {"Piccadilly"}, "Northolt" -> {"Central"}, "Northwick Park" -> {"Metropolitan"}, "Northwood" -> {"Metropolitan"}, "Northwood Hills" -> {"Metropolitan"}, "Notting Hill Gate" -> {"Central", "Circle", "District"}, "Oakwood" -> {"Piccadilly"}, "Old Street" -> {"Northern"}, "Osterley" -> {"Piccadilly"}, "Oval" -> {"Northern"}, "Oxford Circus" -> {"Bakerloo", "Central", "Victoria"}, "Paddington" -> {"Bakerloo", "Circle", "District", "Hammersmith & City"}, "Park Royal" -> {"Piccadilly"}, "Parsons Green" -> {"District"}, "Perivale" -> {"Central"}, "Piccadilly Circus" -> {"Bakerloo", "Piccadilly"}, "Pimlico" -> {"Victoria"}, "Pinner" -> {"Metropolitan"}, "Plaistow" -> {"District", "Hammersmith & City"}, "Preston Road" -> {"Metropolitan"}, "Putney Bridge" -> {"District"}, "Queen's Park" -> {"Bakerloo"}, "Queensbury" -> {"Jubilee"}, "Queensway" -> {"Central"}, "Ravenscourt Park" -> {"District"}, "Rayners Lane" -> {"Metropolitan", "Piccadilly"}, "Redbridge" -> {"Central"}, "Regent's Park" -> {"Bakerloo"}, "Richmond" -> {"District"}, "Rickmansworth" -> {"Metropolitan"}, "Roding Valley" -> {"Central"}, "Royal Oak" -> {"Circle", "Hammersmith & City"}, "Ruislip" -> {"Metropolitan", "Piccadilly"}, "Ruislip Gardens" -> {"Central"}, "Ruislip Manor" -> {"Metropolitan", "Piccadilly"}, "Russell Square" -> {"Piccadilly"}, "St. James's Park" -> {"Circle", "District"}, "St. John's Wood" -> {"Jubilee"}, "St. Paul's" -> {"Central"}, "Seven Sisters" -> {"Victoria"}, "Shepherd's Bush" -> {"Central"}, "Shepherd's Bush Market" -> {"Circle", "Hammersmith & City"}, "Sloane Square" -> {"Circle", "District"}, "Snaresbrook" -> {"Central"}, "South Ealing" -> {"Piccadilly"}, "South Harrow" -> {"Piccadilly"}, "South Kensington" -> {"Circle", "District", "Piccadilly"}, "South Kenton" -> {"Bakerloo"}, "South Ruislip" -> {"Central"}, "South Wimbledon" -> {"Northern"}, "South Woodford" -> {"Central"}, "Southfields" -> {"District"}, "Southgate" -> {"Piccadilly"}, "Southwark" -> {"Jubilee"}, "Stamford Brook" -> {"District"}, "Stanmore" -> {"Jubilee"}, "Stepney Green" -> {"District", "Hammersmith & City"}, "Stockwell" -> {"Northern", "Victoria"}, "Stonebridge Park" -> {"Bakerloo"}, "Stratford" -> {"Central", "Jubilee"}, "Sudbury Hill" -> {"Piccadilly"}, "Sudbury Town" -> {"Piccadilly"}, "Swiss Cottage" -> {"Jubilee"}, "Temple" -> {"Circle", "District"}, "Theydon Bois" -> {"Central"}, "Tooting Bec" -> {"Northern"}, "Tooting Broadway" -> {"Northern"}, "Tottenham Court Road" -> {"Central", "Northern"}, "Tottenham Hale" -> {"Victoria"}, "Totteridge & Whetstone" -> {"Northern"}, "Tower Hill" -> {"Circle", "District"}, "Tufnell Park" -> {"Northern"}, "Turnham Green" -> {"District", "Piccadilly"}, "Turnpike Lane" -> {"Piccadilly"}, "Upminster" -> {"District"}, "Upminster Bridge" -> {"District"}, "Upney" -> {"District"}, "Upton Park" -> {"District", "Hammersmith & City"}, "Uxbridge" -> {"Metropolitan", "Piccadilly"}, "Vauxhall" -> {"Victoria"}, "Victoria" -> {"Circle", "District", "Victoria"}, "Walthamstow Central" -> {"Victoria"}, "Wanstead" -> {"Central"}, "Warren Street" -> {"Northern", "Victoria"}, "Warwick Avenue" -> {"Bakerloo"}, "Waterloo" -> {"Bakerloo", "Jubilee", "Northern", "Waterloo & City"}, "Watford" -> {"Metropolitan"}, "Wembley Central" -> {"Bakerloo"}, "Wembley Park" -> {"Jubilee", "Metropolitan"}, "West Acton" -> {"Central"}, "West Brompton" -> {"District"}, "West Finchley" -> {"Northern"}, "West Ham" -> {"District", "Hammersmith & City", "Jubilee"}, "West Hampstead" -> {"Jubilee"}, "West Harrow" -> {"Metropolitan"}, "West Kensington" -> {"District"}, "West Ruislip" -> {"Central"}, "Westbourne Park" -> {"Circle", "Hammersmith & City"}, "Westminster" -> {"Circle", "District", "Jubilee"}, "White City" -> {"Central"}, "Whitechapel" -> {"District", "Hammersmith & City"}, "Willesden Green" -> {"Jubilee"}, "Willesden Junction" -> {"Bakerloo"}, "Wimbledon" -> {"District"}, "Wimbledon Park" -> {"District"}, "Wood Green" -> {"Piccadilly"}, "Wood Lane" -> {"Circle", "Hammersmith & City"}, "Woodford" -> {"Central"}, "Woodside Park" -> {"Northern"}|>;

KeyValueMap[{#, f[#] == #2} &, testData] // Grid

Kotlin, 2271 2270 2000 1694 bytes

{x->val r=java.util.Base64.getDecoder().decode("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=")
var I=java.util.zip.Inflater()
I.setInput(r)
I.finished()
var o=ByteArray(1846)
I.inflate(o)
var v=String(o).split("~")
Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).filter{x.hashCode()%2897==it.groupValues[1].toInt()}.map{it.groupValues[2].map{v[0].split("|")[it-'A']}}.first()}

Beautified

{x->
    // Parses the data line into groups of <hashcode % 2897, and line numbers within the list below as letters
    val r = java.util.Base64.getDecoder().decode("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=")
    var I = java.util.zip.Inflater()
    I.setInput(r)
    I.finished()
    var o = ByteArray(1846)
    I.inflate(o)
    var v= String(o).split("~")
    Regex("(-?[0-9]+)([A-Z]+)")
            // Finds all the groups
            .findAll(v[1])// Gets the right group
            .filter{ x.hashCode()%2897==it.groupValues[1].toInt()}
            // Gets each letter and turns it into a station name
            .map{
                it.groupValues[2].map{
                    v[0]
                            .split("|")[it-'A']}}.first()
}

Test

var v:(String)->List<String> =
{x->val r=java.util.Base64.getDecoder().decode("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=")
var I=java.util.zip.Inflater()
I.setInput(r)
I.finished()
var o=ByteArray(1846)
I.inflate(o)
var v=String(o).split("~")
Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).filter{x.hashCode()%2897==it.groupValues[1].toInt()}.map{it.groupValues[2].map{v[0].split("|")[it-'A']}}.first()}
data class TestData(val name: String, val lines: List<String>)

fun main(args: Array<String>) {
    var items = listOf(
            TestData("Acton Town", listOf("District", "Piccadilly")),
            TestData("Aldgate", listOf("Circle", "Metropolitan")),
            TestData("Aldgate East", listOf("District", "Hammersmith & City")),
            TestData("Alperton", listOf("Piccadilly")),
            TestData("Amersham", listOf("Metropolitan")),
            TestData("Angel", listOf("Northern")),
            TestData("Archway", listOf("Northern")),
            TestData("Arnos Grove", listOf("Piccadilly")),
            TestData("Arsenal", listOf("Piccadilly")),
            TestData("Baker Street", listOf("Bakerloo", "Circle", "Hammersmith & City", "Jubilee", "Metropolitan")),
            TestData("Balham", listOf("Northern")),
            TestData("Bank", listOf("Central", "Northern", "Waterloo & City")),
            TestData("Barbican", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Barking", listOf("District", "Hammersmith & City")),
            TestData("Barkingside", listOf("Central")),
            TestData("Barons Court", listOf("District", "Piccadilly")),
            TestData("Bayswater", listOf("Circle", "District")),
            TestData("Becontree", listOf("District")),
            TestData("Belsize Park", listOf("Northern")),
            TestData("Bermondsey", listOf("Jubilee")),
            TestData("Bethnal Green", listOf("Central")),
            TestData("Blackfriars", listOf("Circle", "District")),
            TestData("Blackhorse Road", listOf("Victoria")),
            TestData("Bond Street", listOf("Central", "Jubilee")),
            TestData("Borough", listOf("Northern")),
            TestData("Boston Manor", listOf("Piccadilly")),
            TestData("Bounds Green", listOf("Piccadilly")),
            TestData("Bow Road", listOf("District", "Hammersmith & City")),
            TestData("Brent Cross", listOf("Northern")),
            TestData("Brixton", listOf("Victoria")),
            TestData("Bromley-by-Bow", listOf("District", "Hammersmith & City")),
            TestData("Buckhurst Hill", listOf("Central")),
            TestData("Burnt Oak", listOf("Northern")),
            TestData("Caledonian Road", listOf("Piccadilly")),
            TestData("Camden Town", listOf("Northern")),
            TestData("Canada Water", listOf("Jubilee")),
            TestData("Canary Wharf", listOf("Jubilee")),
            TestData("Canning Town", listOf("Jubilee")),
            TestData("Cannon Street", listOf("Circle", "District")),
            TestData("Canons Park", listOf("Jubilee")),
            TestData("Chalfont & Latimer", listOf("Metropolitan")),
            TestData("Chalk Farm", listOf("Northern")),
            TestData("Chancery Lane", listOf("Central")),
            TestData("Charing Cross", listOf("Bakerloo", "Northern")),
            TestData("Chesham", listOf("Metropolitan")),
            TestData("Chigwell", listOf("Central")),
            TestData("Chiswick Park", listOf("District")),
            TestData("Chorleywood", listOf("Metropolitan")),
            TestData("Clapham Common", listOf("Northern")),
            TestData("Clapham North", listOf("Northern")),
            TestData("Clapham South", listOf("Northern")),
            TestData("Cockfosters", listOf("Piccadilly")),
            TestData("Colindale", listOf("Northern")),
            TestData("Colliers Wood", listOf("Northern")),
            TestData("Covent Garden", listOf("Piccadilly")),
            TestData("Croxley", listOf("Metropolitan")),
            TestData("Dagenham East", listOf("District")),
            TestData("Dagenham Heathway", listOf("District")),
            TestData("Debden", listOf("Central")),
            TestData("Dollis Hill", listOf("Jubilee")),
            TestData("Ealing Broadway", listOf("Central", "District")),
            TestData("Ealing Common", listOf("District", "Piccadilly")),
            TestData("Earl's Court", listOf("District", "Piccadilly")),
            TestData("East Acton", listOf("Central")),
            TestData("East Finchley", listOf("Northern")),
            TestData("East Ham", listOf("District", "Hammersmith & City")),
            TestData("East Putney", listOf("District")),
            TestData("Eastcote", listOf("Metropolitan", "Piccadilly")),
            TestData("Edgware", listOf("Northern")),
            TestData("Edgware Road", listOf("Bakerloo", "Circle", "District", "Hammersmith & City")),
            TestData("Elephant & Castle", listOf("Bakerloo", "Northern")),
            TestData("Elm Park", listOf("District")),
            TestData("Embankment", listOf("Bakerloo", "Circle", "District", "Northern")),
            TestData("Epping", listOf("Central")),
            TestData("Euston", listOf("Northern", "Victoria")),
            TestData("Euston Square", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Fairlop", listOf("Central")),
            TestData("Farringdon", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Finchley Central", listOf("Northern")),
            TestData("Finchley Road", listOf("Jubilee", "Metropolitan")),
            TestData("Finsbury Park", listOf("Piccadilly", "Victoria")),
            TestData("Fulham Broadway", listOf("District")),
            TestData("Gants Hill", listOf("Central")),
            TestData("Gloucester Road", listOf("Circle", "District", "Piccadilly")),
            TestData("Golders Green", listOf("Northern")),
            TestData("Goldhawk Road", listOf("Circle", "Hammersmith & City")),
            TestData("Goodge Street", listOf("Northern")),
            TestData("Grange Hill", listOf("Central")),
            TestData("Great Portland Street", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Greenford", listOf("Central")),
            TestData("Green Park", listOf("Jubilee", "Piccadilly", "Victoria")),
            TestData("Gunnersbury", listOf("District")),
            TestData("Hainault", listOf("Central")),
            TestData("Hammersmith", listOf("Circle", "District", "Hammersmith & City", "Piccadilly")),
            TestData("Hampstead", listOf("Northern")),
            TestData("Hanger Lane", listOf("Central")),
            TestData("Harlesden", listOf("Bakerloo")),
            TestData("Harrow & Wealdstone", listOf("Bakerloo")),
            TestData("Harrow-on-the-Hill", listOf("Metropolitan")),
            TestData("Hatton Cross", listOf("Piccadilly")),
            TestData("Heathrow Terminals 1, 2, 3", listOf("Piccadilly")),
            TestData("Heathrow Terminal 4", listOf("Piccadilly")),
            TestData("Heathrow Terminal 5", listOf("Piccadilly")),
            TestData("Hendon Central", listOf("Northern")),
            TestData("High Barnet", listOf("Northern")),
            TestData("Highbury & Islington", listOf("Victoria")),
            TestData("Highgate", listOf("Northern")),
            TestData("High Street Kensington", listOf("Circle", "District")),
            TestData("Hillingdon", listOf("Metropolitan", "Piccadilly")),
            TestData("Holborn", listOf("Central", "Piccadilly")),
            TestData("Holland Park", listOf("Central")),
            TestData("Holloway Road", listOf("Piccadilly")),
            TestData("Hornchurch", listOf("District")),
            TestData("Hounslow Central", listOf("Piccadilly")),
            TestData("Hounslow East", listOf("Piccadilly")),
            TestData("Hounslow West", listOf("Piccadilly")),
            TestData("Hyde Park Corner", listOf("Piccadilly")),
            TestData("Ickenham", listOf("Metropolitan", "Piccadilly")),
            TestData("Kennington", listOf("Northern")),
            TestData("Kensal Green", listOf("Bakerloo")),
            TestData("Kensington (Olympia)", listOf("District")),
            TestData("Kentish Town", listOf("Northern")),
            TestData("Kenton", listOf("Bakerloo")),
            TestData("Kew Gardens", listOf("District")),
            TestData("Kilburn", listOf("Jubilee")),
            TestData("Kilburn Park", listOf("Bakerloo")),
            TestData("Kingsbury", listOf("Jubilee")),
            TestData("King's Cross St. Pancras", listOf("Circle", "Hammersmith & City", "Metropolitan", "Northern", "Piccadilly", "Victoria")),
            TestData("Knightsbridge", listOf("Piccadilly")),
            TestData("Ladbroke Grove", listOf("Circle", "Hammersmith & City")),
            TestData("Lambeth North", listOf("Bakerloo")),
            TestData("Lancaster Gate", listOf("Central")),
            TestData("Latimer Road", listOf("Circle", "Hammersmith & City")),
            TestData("Leicester Square", listOf("Northern", "Piccadilly")),
            TestData("Leyton", listOf("Central")),
            TestData("Leytonstone", listOf("Central")),
            TestData("Liverpool Street", listOf("Central", "Circle", "Hammersmith & City", "Metropolitan")),
            TestData("London Bridge", listOf("Jubilee", "Northern")),
            TestData("Loughton", listOf("Central")),
            TestData("Maida Vale", listOf("Bakerloo")),
            TestData("Manor House", listOf("Piccadilly")),
            TestData("Mansion House", listOf("Circle", "District")),
            TestData("Marble Arch", listOf("Central")),
            TestData("Marylebone", listOf("Bakerloo")),
            TestData("Mile End", listOf("Central", "District", "Hammersmith & City")),
            TestData("Mill Hill East", listOf("Northern")),
            TestData("Monument", listOf("Circle", "District")),
            TestData("Moorgate", listOf("Circle", "Hammersmith & City", "Metropolitan", "Northern")),
            TestData("Moor Park", listOf("Metropolitan")),
            TestData("Morden", listOf("Northern")),
            TestData("Mornington Crescent", listOf("Northern")),
            TestData("Neasden", listOf("Jubilee")),
            TestData("Newbury Park", listOf("Central")),
            TestData("North Acton", listOf("Central")),
            TestData("North Ealing", listOf("Piccadilly")),
            TestData("North Greenwich", listOf("Jubilee")),
            TestData("North Harrow", listOf("Metropolitan")),
            TestData("North Wembley", listOf("Bakerloo")),
            TestData("Northfields", listOf("Piccadilly")),
            TestData("Northolt", listOf("Central")),
            TestData("Northwick Park", listOf("Metropolitan")),
            TestData("Northwood", listOf("Metropolitan")),
            TestData("Northwood Hills", listOf("Metropolitan")),
            TestData("Notting Hill Gate", listOf("Central", "Circle", "District")),
            TestData("Oakwood", listOf("Piccadilly")),
            TestData("Old Street", listOf("Northern")),
            TestData("Osterley", listOf("Piccadilly")),
            TestData("Oval", listOf("Northern")),
            TestData("Oxford Circus", listOf("Bakerloo", "Central", "Victoria")),
            TestData("Paddington", listOf("Bakerloo", "Circle", "District", "Hammersmith & City")),
            TestData("Park Royal", listOf("Piccadilly")),
            TestData("Parsons Green", listOf("District")),
            TestData("Perivale", listOf("Central")),
            TestData("Piccadilly Circus", listOf("Bakerloo", "Piccadilly")),
            TestData("Pimlico", listOf("Victoria")),
            TestData("Pinner", listOf("Metropolitan")),
            TestData("Plaistow", listOf("District", "Hammersmith & City")),
            TestData("Preston Road", listOf("Metropolitan")),
            TestData("Putney Bridge", listOf("District")),
            TestData("Queen's Park", listOf("Bakerloo")),
            TestData("Queensbury", listOf("Jubilee")),
            TestData("Queensway", listOf("Central")),
            TestData("Ravenscourt Park", listOf("District")),
            TestData("Rayners Lane", listOf("Metropolitan", "Piccadilly")),
            TestData("Redbridge", listOf("Central")),
            TestData("Regent's Park", listOf("Bakerloo")),
            TestData("Richmond", listOf("District")),
            TestData("Rickmansworth", listOf("Metropolitan")),
            TestData("Roding Valley", listOf("Central")),
            TestData("Royal Oak", listOf("Circle", "Hammersmith & City")),
            TestData("Ruislip", listOf("Metropolitan", "Piccadilly")),
            TestData("Ruislip Gardens", listOf("Central")),
            TestData("Ruislip Manor", listOf("Metropolitan", "Piccadilly")),
            TestData("Russell Square", listOf("Piccadilly")),
            TestData("St. James's Park", listOf("Circle", "District")),
            TestData("St. John's Wood", listOf("Jubilee")),
            TestData("St. Paul's", listOf("Central")),
            TestData("Seven Sisters", listOf("Victoria")),
            TestData("Shepherd's Bush", listOf("Central")),
            TestData("Shepherd's Bush Market", listOf("Circle", "Hammersmith & City")),
            TestData("Sloane Square", listOf("Circle", "District")),
            TestData("Snaresbrook", listOf("Central")),
            TestData("South Ealing", listOf("Piccadilly")),
            TestData("South Harrow", listOf("Piccadilly")),
            TestData("South Kensington", listOf("Circle", "District", "Piccadilly")),
            TestData("South Kenton", listOf("Bakerloo")),
            TestData("South Ruislip", listOf("Central")),
            TestData("South Wimbledon", listOf("Northern")),
            TestData("South Woodford", listOf("Central")),
            TestData("Southfields", listOf("District")),
            TestData("Southgate", listOf("Piccadilly")),
            TestData("Southwark", listOf("Jubilee")),
            TestData("Stamford Brook", listOf("District")),
            TestData("Stanmore", listOf("Jubilee")),
            TestData("Stepney Green", listOf("District", "Hammersmith & City")),
            TestData("Stockwell", listOf("Northern", "Victoria")),
            TestData("Stonebridge Park", listOf("Bakerloo")),
            TestData("Stratford", listOf("Central", "Jubilee")),
            TestData("Sudbury Hill", listOf("Piccadilly")),
            TestData("Sudbury Town", listOf("Piccadilly")),
            TestData("Swiss Cottage", listOf("Jubilee")),
            TestData("Temple", listOf("Circle", "District")),
            TestData("Theydon Bois", listOf("Central")),
            TestData("Tooting Bec", listOf("Northern")),
            TestData("Tooting Broadway", listOf("Northern")),
            TestData("Tottenham Court Road", listOf("Central", "Northern")),
            TestData("Tottenham Hale", listOf("Victoria")),
            TestData("Totteridge & Whetstone", listOf("Northern")),
            TestData("Tower Hill", listOf("Circle", "District")),
            TestData("Tufnell Park", listOf("Northern")),
            TestData("Turnham Green", listOf("District", "Piccadilly")),
            TestData("Turnpike Lane", listOf("Piccadilly")),
            TestData("Upminster", listOf("District")),
            TestData("Upminster Bridge", listOf("District")),
            TestData("Upney", listOf("District")),
            TestData("Upton Park", listOf("District", "Hammersmith & City")),
            TestData("Uxbridge", listOf("Metropolitan", "Piccadilly")),
            TestData("Vauxhall", listOf("Victoria")),
            TestData("Victoria", listOf("Circle", "District", "Victoria")),
            TestData("Walthamstow Central", listOf("Victoria")),
            TestData("Wanstead", listOf("Central")),
            TestData("Warren Street", listOf("Northern", "Victoria")),
            TestData("Warwick Avenue", listOf("Bakerloo")),
            TestData("Waterloo", listOf("Bakerloo", "Jubilee", "Northern", "Waterloo & City")),
            TestData("Watford", listOf("Metropolitan")),
            TestData("Wembley Central", listOf("Bakerloo")),
            TestData("Wembley Park", listOf("Jubilee", "Metropolitan")),
            TestData("West Acton", listOf("Central")),
            TestData("West Brompton", listOf("District")),
            TestData("West Finchley", listOf("Northern")),
            TestData("West Ham", listOf("District", "Hammersmith & City", "Jubilee")),
            TestData("West Hampstead", listOf("Jubilee")),
            TestData("West Harrow", listOf("Metropolitan")),
            TestData("West Kensington", listOf("District")),
            TestData("West Ruislip", listOf("Central")),
            TestData("Westbourne Park", listOf("Circle", "Hammersmith & City")),
            TestData("Westminster", listOf("Circle", "District", "Jubilee")),
            TestData("White City", listOf("Central")),
            TestData("Whitechapel", listOf("District", "Hammersmith & City")),
            TestData("Willesden Green", listOf("Jubilee")),
            TestData("Willesden Junction", listOf("Bakerloo")),
            TestData("Wimbledon", listOf("District")),
            TestData("Wimbledon Park", listOf("District")),
            TestData("Wood Green", listOf("Piccadilly")),
            TestData("Wood Lane", listOf("Circle", "Hammersmith & City")),
            TestData("Woodford", listOf("Central")),
            TestData("Woodside Park", listOf("Northern"))
    )

    var good = 0
    var bad = 0

    for (item in items) {
        var out = v(item.name);
        if (item.lines == out) {
            good++
        } else {
            bad++
        }
    }
    println("Results: G $good B $bad")
}

Edits

Removed unneeded pipe separators -270 bytes

Compressed with zip tools -306 bytes