Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve trip display name #174

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

Altonss
Copy link

@Altonss Altonss commented Feb 13, 2025

@Altonss
Copy link
Author

Altonss commented Feb 13, 2025

Also I don't really understand this block just before, for me this isn't need as just the logic route short name > route long should be used.

// route name looks like product name, trip name is number
auto const is_product_name = [=](std::string_view route) {
return utl::all_of(route, [=](char const c) { return !is_digit(c); });
};
auto const is_trip_number = [=](std::string_view trip_name) {
return utl::all_of(trip_name, is_digit);
};
if (!route_->short_name_.empty() && is_product_name(route_->short_name_) &&
!short_name_.empty() && is_trip_number(short_name_)) {
return fmt::format("{} {}", route_->short_name_,
utl::parse<int>(short_name_));
}

[=](std::string_view line_id) {
return !is_digit(line_id.front()) && is_digit(line_id.back());
};
auto precedence = std::array{std::string_view{route_->short_name_},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work for all feeds that use semantic naming instead of the google maps convention.
That is as far as I know most of the data for Germany and Austria

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly doesn't work, not prefering trip short name?
Do you have any specific example in mind?

@Altonss
Copy link
Author

Altonss commented Feb 18, 2025

This should improve the trip short name in the UK, and also for RER in Paris (France).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants