1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
import { m } from './paraglide/messages';
// #region Stations
export const placeNameMap = new Map<string, string>();
for (const [v1, v2] of [
['Freiburg(Brsg)', 'Freiburg(Breisgau) Hbf'],
['Freiburg(Breisgau)', 'Freiburg(Breisgau) Hbf'],
['Freiburg(Breisgau) Hbf', 'Freiburg(Breisgau) Hbf'],
['Freiburg (Breisgau)', 'Freiburg(Breisgau) Hbf'],
['Freiburg (Breisgau) Hbf', 'Freiburg(Breisgau) Hbf'],
['Freiburg im Breisgau', 'Freiburg(Breisgau) Hbf'],
['Freiburg im Breisgau Hbf', 'Freiburg(Breisgau) Hbf'],
['Freiburg im Breisgau Hauptbahnhof', 'Freiburg(Breisgau) Hbf'],
['Freiburg (D)', 'Freiburg(Breisgau) Hbf'],
['Freiburg (D), Busbahnhof', 'Freiburg(Breisgau) Hbf'],
['Freiburg Hauptbahnhof', 'Freiburg(Breisgau) Hbf'],
['S+U Berlin Hauptbahnhof', 'Berlin Hbf'],
['Berlin Hauptbahnhof', 'Berlin Hbf'],
['Hauptbahnhof (oben)', 'Stuttgart Hbf (oben)'], // probably
['de-DELFI_de:08111:6115:1:1', 'Stuttgart Hbf (oben)'],
])
placeNameMap.set(v1.toLowerCase(), v2);
export const normaliseGermanUmlauts = (n: string) => {
return n
.replace(/ü/gu, 'ue')
.replace(/Ü/gu, 'UE')
.replace(/ä/gu, 'ae')
.replace(/Ä/gu, 'AE')
.replace(/ö/gu, 'oe')
.replace(/ß/gu, 'ss');
};
export const normalisePlaceName = (name: string, id?: string) =>
placeNameMap.has(name.toLowerCase())
? placeNameMap.get(name.toLowerCase())!
: id && placeNameMap.has(id)
? placeNameMap.get(id)!
: name;
export const arePlacenamesEqual = (n1: string, n2: string) =>
normalisePlaceName(normaliseGermanUmlauts(n1).toUpperCase()).toUpperCase() ===
normalisePlaceName(normaliseGermanUmlauts(n2)).toUpperCase();
// #endregion
// #region Operators
export const operators = new Map<string, string>();
operators.set('Schweizerische Bundesbahnen SBB', m.operator_sbb());
operators.set('SBB', m.operator_sbb());
operators.set('SZU', m.operator_szu());
operators.set('Sihltal-Zürich-Uetliberg-Bahn', m.operator_szu());
operators.set('Verkehrsbetriebe Zürich', m.operator_vbz()); // buses
operators.set('Verkehrsbetriebe Zürich INFO+', m.operator_vbz()); // trams
operators.set('BLS AG (bls)', m.operator_bls());
operators.set('Städtische Verkehrsbetriebe Bern', m.operator_bernmobil());
operators.set('Regionalverkehr Bern-Solothurn', m.operator_rbs());
operators.set('Verkehrsbetriebe Glattal', m.operator_vbg());
operators.set('OEBB Personenverkehr AG Kundenservice', m.operator_oebb());
operators.set('Österreichische Bundesbahnen', m.operator_oebb());
// #endregion
|