-
Notifications
You must be signed in to change notification settings - Fork 697
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
New Verbal Succinct Transition Instruction #2844
Conversation
…aneuvers_builder and narrative_builder
} | ||
|
||
std::string NarrativeBuilder::FormVerbalSuccinctDestinationTransitionInstruction(Maneuver& maneuver) { | ||
// "0": "You have arrived at your destination." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance this can be even more succinct, You have arrived.
?
|
We will have to discuss this one |
We have quite a few we need to discuss 😄 |
src/odin/maneuversbuilder.cc
Outdated
void ManeuversBuilder::ProcessVerbalSuccinctTransitionInstruction(std::list<Maneuver>& maneuvers) { | ||
for (auto& maneuver : maneuvers) { | ||
if (maneuver.HasStreetNames()) { | ||
std::string street_name = maneuver.street_names().front()->value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to look at word count that matches kVerbalPreElementMaxCount
src/odin/narrativebuilder.cc
Outdated
return instruction; | ||
} | ||
|
||
std::string NarrativeBuilder::FormVerbalSuccinctDestinationTransitionInstruction() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to leave for now since we discussed this.
valhalla/odin/narrativebuilder.h
Outdated
///////////////////////////////////////////////////////////////////////////// | ||
std::string FormVerbalSuccinctStartTransitionInstruction(Maneuver& maneuver); | ||
|
||
std::string FormVerbalSuccinctDestinationTransitionInstruction(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to leave for now since we discussed this.
@@ -79,7 +79,7 @@ void NarrativeBuilder::Build(std::list<Maneuver>& maneuvers) { | |||
|
|||
// Set verbal succinct transition instruction | |||
maneuver.set_verbal_succinct_transition_instruction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the string is large then we will want to set the succinct to either phrase 0
or 2
// "0": "You have arrived at your destination."
// "2": "Your destination is on the <RELATIVE_DIRECTION>."
Otherwise, we do not want to set succinct instruction for the destination maneuver
test/instructions.cc
Outdated
@@ -538,7 +546,8 @@ TEST(Instructions, validate_obvious_maneuver_instructions) { | |||
"test/pinpoints/instructions/obvious_maneuver_short_continue.pbf"}, | |||
expected_routes_size, expected_legs_size, expected_maneuvers_size, maneuver_index, | |||
"Take the PA 39 West/Hersheypark Drive exit toward Attractions.", | |||
"Take the exit.", "Take the Pennsylvania 39 West exit.", | |||
"Take the Pennsylvania 39 West, Hersheypark Drive exit toward Attractions.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not look right - maybe for initial implementation, concentrate on maneuvers that are impacted by long street name - what are your thoughts?
src/odin/narrativebuilder.cc
Outdated
@@ -206,6 +225,10 @@ void NarrativeBuilder::Build(std::list<Maneuver>& maneuvers) { | |||
// Set stay on instruction | |||
maneuver.set_instruction(FormKeepToStayOnInstruction(maneuver)); | |||
|
|||
// Set verbal succinct transition instruction | |||
maneuver.set_verbal_succinct_transition_instruction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove for now
src/odin/narrativebuilder.cc
Outdated
@@ -308,6 +347,10 @@ void NarrativeBuilder::Build(std::list<Maneuver>& maneuvers) { | |||
// Set instruction | |||
maneuver.set_instruction(FormEnterFerryInstruction(maneuver)); | |||
|
|||
// Set verbal succinct transition instruction | |||
maneuver.set_verbal_succinct_transition_instruction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove for now
src/odin/narrativebuilder.cc
Outdated
} | ||
|
||
std::string | ||
NarrativeBuilder::FormVerbalSuccinctKeepTransitionInstruction(Maneuver& maneuver, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove for now
src/odin/narrativebuilder.cc
Outdated
} | ||
|
||
std::string | ||
NarrativeBuilder::FormVerbalSuccinctEnterFerryTransitionInstruction(Maneuver& maneuver, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove for now
@@ -964,6 +966,7 @@ void expect_instructions_at_maneuver_index( | |||
const valhalla::Api& result, | |||
int maneuver_index, | |||
const std::string& expected_text_instruction, | |||
const std::string& expected_verbal_succinct_transition_instruction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably not needed until - maybe only after focused gurka test are complete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably not needed until - maybe only after focused gurka test are complete
or leave in if it is easier to just fix the tests after code is complete
Closing and opened new rebased PR #3128 |
Description
Added logic to directions.proto, maneuver, maneuvers_builder and narrative_builder for a verbal succinct transition instruction.
Issue
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?