View Single Post
  #13   Report Post  
Old July 31st 06, 06:50 PM posted to uk.transport.london
Dr John Stockton Dr John Stockton is offline
external usenet poster
 
First recorded activity at LondonBanter: Aug 2005
Posts: 13
Default Tube quiz name game

JRS: In article , dated Sun,
30 Jul 2006 21:02:17 remote, seen in news:uk.transport.london, Iain
posted :

The code I've written makes it possible to have multiple correct entries
for each station. In some places I've done that to try to catch common
punctuation problems (eg "St. Paul's" and "St Pauls" are equally valid).
You're right about St. John's Wood though, I managed to miss the correct
version out of the synonyms list. I'm open to any suggestions for all
stations, although I dare say that for every person who'd like "King's
Cross" admitted there'll be someone else who swears blind that the only
valid name for the station is "King's Cross St. Pancras".


Strip all punctuation, including spaces, from the user input, and
compare with the correspondingly-stripped real names : i.e. compare only
the letters. I very much doubt whether any clashes will ensue.

It might be worth *first* stripping the *word* "and" which could be
entered as "&".

There's one bug in the above, easy spot and to deal with.

Read the newsgroup FAQ.
--
© John Stockton, Surrey, UK. Turnpike v4.00 IE 4 ©
URL:http://www.jibbering.com/faq/? JL/RC: FAQ of news:comp.lang.javascript
URL:http://www.merlyn.demon.co.uk/js-index.htm jscr maths, dates, sources.
URL:http://www.merlyn.demon.co.uk/ TP/BP/Delphi/jscr/&c, FAQ items, links.