hafas-client
hafas-client copied to clipboard
Collect (And Remove) Prefixes in Train Names
Hello. For some time, the MMM-PublicTransportHafas on my magic mirror displays ugly train names. Instead of "S3", it now says "ABR S3" which tells me the train is being operated by a private company named abellio.
This issue is about collecting trains and connections that have this issue to parse them (I guess)
I see two ways to tackle this:
- Manually maintain a list a list of rules (e.g.
/^abr\s+/i -> ''
). Will be easy to implement, but a lot of work to maintain. - attempt to clean the line names using context (
line.operator
, OpenStreetMap, Wikidata, etc). Will likely be complex and "heavy" (require many dependencies, pull a lot of data, etc).
Probably both will be need to achieve reasonable coverage; @juliuste implemented this combination for DB station names, let's do the same with line names.
For Germany/Deutsche Bahn for example, this logic is useful far beyond the scope of hafas-client
, so I'd like to do this in a separate repo which db-hafas
. Let's create a repo for this and compile a list there!
Ok, so what’s the Plan Right now? Where and how to help?
For the list part: it might be easier to work backwards and take a look at the private team operators and check which of these do have their own prefix. Wikipedia provides a long list. It might miss some operators but is still a good source
For the list part: it might be easier to work backwards and take a look at the private team operators and check which of these do have their own prefix. Wikipedia provides a long list. It might miss some operators but is still a good source
Sure, if you want to help, start a list with prefixes! Your contribution is appreciated!
For each prefix, note down a link to their Wikipedia page, website or at least a name of the operator.
At the DB Reiseauskunft, I could confirm the use of the following prefixes:
- ABR - abellio
- ME - metronom
- NWB - NordWestBahn
- NBE - nordbahn
- BOB - Bayerische Oberlandbahn
- BRB - Bayrische Regiobahn
- M - Meridian (their connections do not have an additional RE or RB)
- ERX - erixx
- WEG - Württembergische Eisenbahn-Gesellschaft
- VBG - Vogtlandbahn
- TLX -Trilex
- WBA - Waldbahn (their connections do not have an additional RE or RB)
- BLB - Berchtesgadener Land Bahn
- ALX - Die Länderbahn
- OPB - Die Länderbahn
At the same time, I can confirm that the following operators operate connections without such prefixes:
That's it for now.
@derhuerst what's up next? when do you expect to implement the list?