Skip to main content

Module resolve

Module resolve 

Source
Expand description

From what the caller typed to a stop ID: an ID is used as it is, a name only if it names one stop. A wrong stop gives wrong connections that look right, so a doubtful name is an error with the candidates, never a guess.

Only the names count: a match whose name is the query (ignoring case, punctuation and spacing), else the only match that contains every word of the query. Matches with the same name count as one.

Constants§

MAX_CANDIDATES
The most candidates an Error::AmbiguousStop lists.

Functions§

choose
The stop query names among the stops found for it.
coordinates
Coordinates LAT,LON, which a trip search accepts as a place.
is_stop_id
Whether the input is a stop ID rather than a name: an external ID like 3000010, or a HAFAS ID like A=1@O=Frankfurt (Main) Hbf@L=3000010@.