Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect (And Remove) Prefixes in Train Names #172

Open
nixmeer opened this issue Mar 26, 2020 · 5 comments
Open

Collect (And Remove) Prefixes in Train Names #172

nixmeer opened this issue Mar 26, 2020 · 5 comments

Comments

@nixmeer
Copy link

nixmeer commented Mar 26, 2020

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)

@derhuerst
Copy link
Member

I see two ways to tackle this:

  1. 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.
  2. 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!

@nixmeer
Copy link
Author

nixmeer commented Apr 6, 2020

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

@derhuerst
Copy link
Member

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.

@nixmeer
Copy link
Author

nixmeer commented May 2, 2020

At the DB Reiseauskunft, I could confirm the use of the following prefixes:

At the same time, I can confirm that the following operators operate connections without such prefixes:

That's it for now.

@nixmeer
Copy link
Author

nixmeer commented May 13, 2020

@derhuerst what's up next? when do you expect to implement the list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants