iRail / stations

A list of all the Belgian stations and their properties used within the iRail project
http://irail.be/stations/NMBS
29 stars 20 forks source link

Official station names vs. alternatives #13

Open jncn opened 9 years ago

jncn commented 9 years ago

How do we handle official names and their alternatives? e.g. Brussel-Nationaal-Luchthaven vs. Brussels-Airport or Amsterdam CS (old name) vs. Amsterdam Centraal (official name).

pietercolpaert commented 9 years ago

That's a good question. This is where our CSV model gets a bit too limited. If we add 1 alternative, the alternative should also be translated, right?

Should we change our repository to use JSON instead?

pietercolpaert commented 9 years ago

As I've understood from our conversation at https://gitter.im/iRail/iRail, you're using this repo to load the stations inside SQLite. I think therefore keeping our CSV table as is is a good idea.

Another possible solution would be to add yet an extra column for autocomplete purposes: alternative-1 alternative-2 ...

What do you think?

brechtvdv commented 9 years ago

I don't think adding extra columns for alternatives is feasible.. See also: https://github.com/iRail/iRail/issues/68

brechtvdv commented 9 years ago

I suggest we add an extra csv-file with two columns: alternative-name and official name. Much easier to maintain

pietercolpaert commented 9 years ago

Right now our kind of organically grown method is to hardcode them in our "autocomplete" code in PHP: https://github.com/iRail/stations/blob/master/src/irail/stations/Stations.php#L33

For instance, we could also add that everything that's "CS" is replaced with "centraal"?

Of course this doesn't help other programming languages...