Loading lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm +2 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ use Carp qw(cluck); our $VERSION = '0.31'; Travel::Status::DE::DBRIS::Formation::Carriage->mk_ro_accessors( qw(class_type is_closed is_dosto is_locomotive is_powercar number model section uic_id type number model section uic_id country type start_meters end_meters length_meters start_percent end_percent length_percent has_priority_seats has_ac has_quiet_zone has_bahn_comfort has_wheelchair_space has_wheelchair_toilet has_family_zone has_infant_cabin has_info has_bistro Loading Loading @@ -51,6 +51,7 @@ sub new { if ( defined $ref->{uic_id} ) { $ref->{uic_id} =~ s{ ^ \d{11} \K - }{}x; $ref->{country} = substr( $ref->{uic_id}, 2, 2 ); } if ( defined $ref->{model} ) { $ref->{model} =~ s{^.....(...)...-?.(?:-.)?$}{$1} Loading lib/Travel/Status/DE/DBRIS/Formation/Group.pm +171 −165 Original line number Diff line number Diff line Loading @@ -497,10 +497,8 @@ sub parse_model { next; } if ( $carriage->model == 23 ) { $ml{'023'}++; } elsif ($carriage->model == 91 if ( $carriage->country == 80 ) { if ( $carriage->model == 91 or $carriage->model == 491 or $carriage->model == 791 or $carriage->model == 891 ) Loading Loading @@ -660,10 +658,18 @@ sub parse_model { elsif ( $self->train_type eq 'IC' and $carriage->is_dosto ) { $ml{'IC2.TWIN'}++; } elsif ( substr( $carriage->uic_id, 4, 4 ) eq '4011' ) { } elsif ( $carriage->country == 81 ) { if ( substr( $carriage->uic_id, 4, 4 ) eq '4011' ) { $ml{'011'}++; } } elsif ( $carriage->country == 82 ) { if ( $carriage->model == 23 ) { $ml{'023'}++; } } } my @likelihood = reverse sort { $ml{$a} <=> $ml{$b} } keys %ml; Loading Loading
lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm +2 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ use Carp qw(cluck); our $VERSION = '0.31'; Travel::Status::DE::DBRIS::Formation::Carriage->mk_ro_accessors( qw(class_type is_closed is_dosto is_locomotive is_powercar number model section uic_id type number model section uic_id country type start_meters end_meters length_meters start_percent end_percent length_percent has_priority_seats has_ac has_quiet_zone has_bahn_comfort has_wheelchair_space has_wheelchair_toilet has_family_zone has_infant_cabin has_info has_bistro Loading Loading @@ -51,6 +51,7 @@ sub new { if ( defined $ref->{uic_id} ) { $ref->{uic_id} =~ s{ ^ \d{11} \K - }{}x; $ref->{country} = substr( $ref->{uic_id}, 2, 2 ); } if ( defined $ref->{model} ) { $ref->{model} =~ s{^.....(...)...-?.(?:-.)?$}{$1} Loading
lib/Travel/Status/DE/DBRIS/Formation/Group.pm +171 −165 Original line number Diff line number Diff line Loading @@ -497,10 +497,8 @@ sub parse_model { next; } if ( $carriage->model == 23 ) { $ml{'023'}++; } elsif ($carriage->model == 91 if ( $carriage->country == 80 ) { if ( $carriage->model == 91 or $carriage->model == 491 or $carriage->model == 791 or $carriage->model == 891 ) Loading Loading @@ -660,10 +658,18 @@ sub parse_model { elsif ( $self->train_type eq 'IC' and $carriage->is_dosto ) { $ml{'IC2.TWIN'}++; } elsif ( substr( $carriage->uic_id, 4, 4 ) eq '4011' ) { } elsif ( $carriage->country == 81 ) { if ( substr( $carriage->uic_id, 4, 4 ) eq '4011' ) { $ml{'011'}++; } } elsif ( $carriage->country == 82 ) { if ( $carriage->model == 23 ) { $ml{'023'}++; } } } my @likelihood = reverse sort { $ml{$a} <=> $ml{$b} } keys %ml; Loading