Loading lib/Travel/Status/DE/IRIS/Stations.pm +15206 −15087 File changed.Preview size limit exceeded, changes collapsed. Show changes scripts/acronyms.pl +20 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,20 @@ sub get_stations { return @stations; } sub normalize { my ($val) = @_; $val =~ s{Ä}{Ae}g; $val =~ s{Ö}{Oe}g; $val =~ s{Ü}{Ue}g; $val =~ s{ä}{ae}g; $val =~ s{ö}{oe}g; $val =~ s{ß}{sz}g; $val =~ s{ü}{ue}g; return $val; } sub get_station { my ( $name ) = @_; Loading @@ -67,6 +81,12 @@ sub get_station_by_name { return ($actual_match); } $nname = normalize($nname); $actual_match = firstval { $nname eq normalize(lc($_->[1])) } @stations; if ($actual_match) { return $actual_match; } return ( grep { $_->[1] =~ m{$name}i } @stations ); } Loading Loading
lib/Travel/Status/DE/IRIS/Stations.pm +15206 −15087 File changed.Preview size limit exceeded, changes collapsed. Show changes
scripts/acronyms.pl +20 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,20 @@ sub get_stations { return @stations; } sub normalize { my ($val) = @_; $val =~ s{Ä}{Ae}g; $val =~ s{Ö}{Oe}g; $val =~ s{Ü}{Ue}g; $val =~ s{ä}{ae}g; $val =~ s{ö}{oe}g; $val =~ s{ß}{sz}g; $val =~ s{ü}{ue}g; return $val; } sub get_station { my ( $name ) = @_; Loading @@ -67,6 +81,12 @@ sub get_station_by_name { return ($actual_match); } $nname = normalize($nname); $actual_match = firstval { $nname eq normalize(lc($_->[1])) } @stations; if ($actual_match) { return $actual_match; } return ( grep { $_->[1] =~ m{$name}i } @stations ); } Loading