• Our new ticketing site is now live! Using either this or the original site (both powered by TrainSplit) helps support the running of the forum with every ticket purchase! Find out more and ask any questions/give us feedback in this thread!

Automated expansion of three letter station codes

Status
Not open for further replies.

jfollows

Established Member
Joined
26 Feb 2011
Messages
10,161
Location
Wilmslow
Given that the forum has some capability for post-processing of forum posts, for example the "automerge" capability, would it be possible to enable some kind of sensible expansion of the three-letter station codes which some people like to use?

What I'm thinking is that some people like to write "BNS" when they could write "Barnes", but they often feel happy using the codes, perhaps because they're writing their post on a phone and it's just easier for them, or other reasons.

Now I hate reading these posts because my brain finds it hard to work out what is meant.

I was thinking - could something be set up so that if these codes are used, perhaps with an additional marker, for example "^BNS", the text could be expanded to something like "BNS (Barnes)" automatically?

I'm just thinking this could be useful to accommodate the needs and preferences of people who want to use these codes and to make pedants like me happy who don't like reading them?

Is this a good suggestion, does it find favour, could it be done, is this posted in the right part of the forum?
 
Sponsor Post - registered members do not see these adverts; click here to register, or click here to log in
R

RailUK Forums

pdeaves

Established Member
Joined
14 Sep 2014
Messages
5,932
Location
Gateway to the South West
As long as there is some marker to say 'this is a station code' than that is helpful (otherwise every instance of 'the' will render as Theale!).
 

jfollows

Established Member
Joined
26 Feb 2011
Messages
10,161
Location
Wilmslow
As long as there is some marker to say 'this is a station code' than that is helpful (otherwise every instance of 'the' will render as Theale!).
I think that the parser would need to look for ^XXXn in the first place in which ^ is a marker, X are capital letters and n is a non-letter or non-capital, yes.

== Doublepost prevention - post automatically merged: ==

Further thoughts:
  1. If we think it's a good idea, then we can discuss the requirements here for a while to ensure that we come up with a clear understanding.
  2. if there's any coding involved, I'm happy to do this and hand it over to the people who run the forum for them to implement and own.
 
Last edited:

pdeaves

Established Member
Joined
14 Sep 2014
Messages
5,932
Location
Gateway to the South West
Potential situation where 'it won't work'. Given that people are supposed to spell out the code in full first time it's used but often don't, will people take on adding an extra character (or other distinguisher)?
 

2192

Member
Joined
16 Aug 2020
Messages
372
Location
Derby UK
Are you going to include Engineers' Line References as well? If so, add in the complication that some folk write BML to mean Brighton Main Line when the code is VTB. (BML is the LSW main line).
 

skyhigh

Established Member
Joined
14 Sep 2014
Messages
6,897
What I'm thinking is that some people like to write "BNS" when they could write "Barnes", but they often feel happy using the codes, perhaps because they're writing their post on a phone and it's just easier for them, or other reasons.

Now I hate reading these posts because my brain finds it hard to work out what is meant.
Would be even harder working out what's meant when somebody writes BNS meaning Birmingham New Street but the software changes it to Barnes ;)
 

jfollows

Established Member
Joined
26 Feb 2011
Messages
10,161
Location
Wilmslow
Are you going to include Engineers' Line References as well? If so, add in the complication that some folk write BML to mean Brighton Main Line when the code is VTB. (BML is the LSW main line).
At this point (1) I don't know whether or not this is possible and (2) I look to you to tell me whether you think it's a good idea and what you'd like to see if you think it's a good idea. Just speculative at this stage. My thinking is that "any" three-letter code could be expanded if there's a look-up table for it.

== Doublepost prevention - post automatically merged: ==

Would be even harder working out what's meant when somebody writes BNS meaning Birmingham New Street but the software changes it to Barnes ;)
Well, exactly, but at least the error would be clear pretty quickly then wouldn't it?

== Doublepost prevention - post automatically merged: ==

The other thought I had is that this forum gets searched and indexed by popular Web search engines, so posts can often appear through Google (etc) searches, and to the uninitiated the use of codes without explanation is probably more confusing than it need be. So I was wondering if my suggestion could improve that.
 
Last edited:

SargeNpton

Established Member
Joined
19 Nov 2018
Messages
1,748
Of course, we could just get people to type out the station names instead. Or is that too radical?
 

jfollows

Established Member
Joined
26 Feb 2011
Messages
10,161
Location
Wilmslow
Of course, we could just get people to type out the station names instead. Or is that too radical?
Yes, that'd be great.
I've reluctantly reported several posts to the moderators recently because they're full of "WOL" and "NMP" and "WML" sort of stuff which I simply don't like, and they've reported back that they've asked the posters to fix their posts.
So it may just be me who finds this stuff hard to read, but I was trying to think of a way of making life "easier" for people who want to use these codes in their posts and also make me happy.
Maybe it's not really a problem, maybe it's just me. I'm interested in all thoughts and comments!
 

Pigeon

Member
Joined
8 Apr 2015
Messages
1,123
DIY client side:

Untested. Written off the top of my head and typed directly into the reply form. May contain bugs, typos etc.

Wrap this in whatever incantations your browser needs to make it insert user-supplied javascript into pages served from railforums.co.uk (if there are no such incantations available, get a better browser, arf arf).

It SHOULD replace station abbreviations with the abbreviation in underlined text which you can hover over to make the expanded name appear (so if it does get it wrong, at least it doesn't shove it in your face).

Code:
(function() {
    // I can post the entire list if you ask me but it might be a bit out of date, or supply your own
    var abbrs = { ABA: "Aberdare", ABD: "Aberdeen", ABE: "Aber", .... , YVJ: "Yeovil Junction", YVP: "Yeovil Pen Mill" };

    function lookup(a, x) {
        return abbrs[x] ? "<span style=\"text-decoration: underline;\" title=\"" + abbrs[x] + "\">" + x + "</span>" : x;
    }

    function expand_abbrs() {
        Array.prototype.forEach.call(document.getElementsByClassName("message-body"), function(o) {
            o.innerHTML = o.innerHTML.replace(/\b[A-Z]{3}\b/g, lookup);
        });
    }

    window.addEventListener("DOMContentLoaded", expand_abbrs, false);
})();
 

aleggatta

Member
Joined
28 Sep 2015
Messages
566
I wonder (not a coder, could be more trouble than its worth!) whether when someone composes a reply, if the draft box could offer the option of the fully completed name, allowing people to correct the three letter station code with a single click? you might want some exceptions (i.e. Theale). I think the important thing is that someones post isn't changed after they post their reply, but I could see more functionality coming to the reply box? Might be more of a forum wide issue though, with some 'codes' on some threads having different meanings to others (E.g. MOS on here referring to a motor coach on a MU, and it offering up Moss Side)?
 

etr221

Established Member
Joined
10 Mar 2018
Messages
1,606
A quick wonder - is there a 'spell check' type function available which could offer an amendment to provide the station name/whatever?

(And an aside - over time, have 'CRS' (and other) station codes been unique? Or have some been reused?)
 

30907

Veteran Member
Joined
30 Sep 2012
Messages
21,988
Location
Airedale
I am not a coder (among other things!) but a warning: drehscheibe-online offers the option of expanding abbreviations, but when I tried it a couple of years ago I found it expanded stuff that wasn't a station/depot (etc) code at all, and switched it off. So it would need care.
 

SargeNpton

Established Member
Joined
19 Nov 2018
Messages
1,748
A quick wonder - is there a 'spell check' type function available which could offer an amendment to provide the station name/whatever?

(And an aside - over time, have 'CRS' (and other) station codes been unique? Or have some been reused?)

One instance of re-use: ANY was Anerley, but was taken over by the reservations system some years ago to mean "any station". Anerley is now ANZ.

Where stations have been re-named, their codes have often changed as a consequence: e.g. when Smitham became Coulsdon Town.
 

Western Sunset

Established Member
Joined
23 Dec 2014
Messages
3,064
Location
Wimborne, Dorset
The trouble with all these codes is that some are counter-intuitive; well to me at any rate. I think of BNS as Birmingham New Street, whilst (to me) BTM is Bristol Temple Meads.
 

AndyW33

Member
Joined
12 Aug 2013
Messages
541
As a general transport enthusiast, I belonged to an aviation forum which used to convert airline codes and airport codes in posts. It doesn't any more. The issue was at least in part that airline codes definitely are re-used, so historical discussions became unbelievably confusing, and airport codes are also sometimes reused. There was also a problem in ensuring the underlying data was kept current, which came to a head when the ownership of the forum changed, and finally, ordinary two and three letter words kept getting converted into airlines/airport names!
 

randyrippley

Established Member
Joined
21 Feb 2016
Messages
5,382
You don't need a technical solution to fix a problem caused by a mixture of laziness and insider snobishness
 

XAM2175

Established Member
Joined
8 Jun 2016
Messages
3,471
Location
Glasgow
As a general transport enthusiast, I belonged to an aviation forum which used to convert airline codes and airport codes in posts. It doesn't any more. The issue was at least in part that airline codes definitely are re-used, so historical discussions became unbelievably confusing, and airport codes are also sometimes reused. There was also a problem in ensuring the underlying data was kept current, which came to a head when the ownership of the forum changed, and finally, ordinary two and three letter words kept getting converted into airlines/airport names!
The actual reason it was discontinued was that they changed from an old unsupported forum software to phpBB and couldn't find a way to bring the conversion code over into the new setup - but given all the issues you've noted there wasn't a great deal of enthusiasm for it anyway. Better to simply have the rules about the use of internal codes and make sure they're consistently applied.
 

PeterY

Established Member
Joined
2 Apr 2013
Messages
1,363
Of course, we could just get people to type out the station names instead. Or is that too radical?
I struggle to work out some of the XXX codes. The only ones I get quickly are the stations with 3 letters , like Rye, Ayr etc. :D If I ever ask for trip advice I always use the full station names but only shorten the word Junction to JCT .
 
Status
Not open for further replies.

Top